Blog

  • How to build LanguageTool API Portainer with nginx

    I have been using Grammarly for my work and to strengthen my writing skills. I was looking for something cheaper and more affordable, and I found this LanguageTool, which offers an API on Docker, and it works great. We won’t get premium, though… they’re not yet available for self-hosted premium.

    Before we start, please make sure your NGINX Proxy Manager and Portainer are up and running. It is unnecessary to establish a network as it has already been integrated into Docker.

    Go to Portainer sites→ Login admin→ stacks → add stacks:

    version: "3"
    services:
      languagetool:
        image: erikvl87/languagetool
        container_name: applegate-languagetool
        networks:
            - nginx
        environment:
            - langtool_languageModel=/ngrams  # OPTIONAL: Using ngrams data
            - Java_Xms=512m  # OPTIONAL: Setting a minimal Java heap size of 512 mib
            - Java_Xmx=1g  # OPTIONAL: Setting a maximum Java heap size of 1 Gib
        volumes:
            - /mnt/applegate5tb/language-tool/data:/ngrams
    networks:
      nginx:
        external: true

    Now deploy the stack and open the nginx proxy manager sites to add this secure HTTPS site. Let’s get started.

    Scheme – HTTP
    Forward Hostname – your container_name
    Forward Port – 8010 (Default on docker for LanguageTool).
    Ensure enable SSL and HTTP/2 and HSTS

    Your websites have been successfully launched. Go check it out and try the API out.

    To connect to this API, please download language tools for Edge or Firefox or Chrome. Please note that Desktop PCs do not yet have API support. Stay tuned on this.

  • How to set up the Collabora office with portainer and Nginx.

    My goal to make my Nextcloud to become Google Workspace because my goal is our data most important to privacy with our data sensitive. And I would like to purchase free instead of paid Google Workspace because we have our server, and we use it for IT documents and resources.

    So, you need to make sure nginx proxy manger and Portainer Up running before we start this.

    We do not need to create a network because we already did created with nginx proxy manager (nginx)

    Portainer sites → login admin account → stacks → add stacks

    version: '2'
    services:
       applegateoffice:
         container_name: collabora
         image: collabora/code:latest
         restart: always
         expose:
           - 9980
         cap_add:
           - MKNOD
         networks:
           - nginx
         environment:
           - username=yourusername
           - password=yourpassword
           - aliasgroup1=https://yoursubdomain.yourdomain.io
           - aliasgroup2=https://yoursubdomain.yourdomain.io
           - extra_params=--o:net.proto=IPv4
    
    
    networks:
      nginx:
        external: true

    Start the deployment and go to nginx proxy manager to add proxy host detail.

    Advanced Custom Nginx Configuration

    # static files
    location ^~ /loleaflet {
      proxy_pass $forward_scheme://$server:$port;
      proxy_set_header Host $http_host;
    }
    
    # WOPI discovery URL
    location ^~ /hosting/discovery {
      proxy_pass $forward_scheme://$server:$port;
      proxy_set_header Host $http_host;
    }
    
    # main websocket
    location ~ ^/lool/(.*)/ws$ {
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_http_version 1.1;
      proxy_pass $forward_scheme://$server:$port;
      proxy_set_header Host $http_host;
      proxy_read_timeout 36000s;
    }
    
    # download, presentation and image upload
    location ~ ^/lool {
      proxy_pass $forward_scheme://$server:$port;
      proxy_set_header Host $http_host;
    }
    
    # Admin Console websocket
    location ^~ /lool/adminws {
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_http_version 1.1;
      proxy_pass $forward_scheme://$server:$port;
      proxy_set_header Host $http_host;
      proxy_read_timeout 36000s;
    }

    Once the configuration has been saved, proceed to open the newly created domain.

    Now we go over the Nextcloud

    Save and your sites are now in collaboration with the office.

  • How to build Redis on Portainer (Stacks) and attach to Nextcloud docker network

    I have developed Redis for my Nextcloud to prevent file locking errors, thereby facilitating smooth uploads and enabling 24/7 usage instead of a failure to upload.

    Lets start by creating a network.

    docker network create redis

    Then go Portainer to create stacks.

    Portainer site → login admin account → stacks → add stacks

    version: '3.3'
    services:
      redis:
        container_name: redis
        image: redis
        networks:
          - redis
        restart: unless-stopped
        command: redis-server --requirepass KWPvQ9VQ%V3KKShgg%SDq
    networks:
      redis:
        external: true

    Deploy the stack and this app is now online. Make sure you put Nextcloud config to connect to the Redis server we created.

    config.php – added my sever Redis information going in Nextcloud’s config.php
      'memcache.local' => '\\OC\\Memcache\\APCu',
      'filelocking.enabled' => true,
      'memcache.locking' => '\\OC\\Memcache\\Redis',
      'redis' =>
      array (
        'host' => 'redis',
        'port' => 6379,
        'timeout' => 0.0,
        'password' => 'KWPvQ9VQ%V3KKShgg%SDq',
      ),

    You’re now ready to use Redis with your Nextcloud.

  • How to build VaultWarden/MariaDB on Portainer with Nginx

    VaultWarden is a password manager, this app is the best I have, and my company uses this password manager. It is very helpful for our team to be able to log in for our business and help employees access it, instead of waiting for the leader or owner to respond. You should build this for your small business or over 500 employees. It will help save you from headaches. And times.

    Before we begin, please verify you are running the Portainer and Nginx Proxy Manager.

    We will need to go to PhpMyAdmin and create a Database and User for the VaultWarden. If you do not have one, please follow these steps. This instruction to set up PhpMyAdmin.

    Sign in to PhpMyAdmin and make a database.

    Login to your admin account

    Then click ‘New’ for the database to be created.

    Create any name you prefer, only you need to make sure it matches on your docker-compose below.

    Now we need to create a user, so we have to go to “privileges” in the menu.

    Click Privileges on the top bar

    Then click add user account

    Make sure you create a username and password(I used generate password) since it is not exposed public, so my database is safe.

    Now, we will create the vault warden on Portainer.

    Open Portainer site → login admin → stacks → Add Stacks:

    version: '3.3'
    services:
      vaultwarden:
        networks:
          - nginx
          - mariadb
        container_name: vaultwarden
        image: vaultwarden/server:latest
        restart: unless-stopped
        environment:
          - ROCKET_PORT=80
          - DATABASE_URL=mysql://user:password@databasecontainer_name:3306/databasename
          - ADMIN_TOKEN=
          - TZ=America/los_Angeles
          - SMTP_HOST=mail.email.com
          - SMTP_FROM=username@email.com
          - SMTP_PORT=465
          - SMTP_SECURITY=force_tls
          - SMTP_USERNAME=username@email.com
          - SMTP_PASSWORD=P@ssW0rd
          - WEBSOCKET_ENABLED=true
        expose:
          - 80
          - 3012
        volumes:
          - /mnt/applegatebackup/vaultwarden/data/:/data/
    networks:
      nginx:
       external: true
      mariadb:
       external: true

    Please ensure that you have modified the admin token, SMTP environment, and database.

  • How to set up Portainer with nginx Proxy Manager.

    Step 1 – Setting up Docker and Portainer

    Before we start, you will need to install Docker and Docker-Compose on your Linux server before we can start this.

    Install Docker Engine on Ubuntu | Docker Documentation

    Since we don’t have one in the active tutorial, we have to create Portainer on Docker Compose in SSH Terminal instead of Portainer WebGui, since we don’t have one.

    1. I am not using Docker Volumes to save our data, so create the folder where you want to save because I am not using Docker Volumes for a reason.

    mkdir /mnt/nasdrive/portainer/ && mkdir /mnt/nasdrive/nginx 

    2. In the SSH terminal, create the network for nginx.

    docker network create nginx

    3. Please go to the folder you created for Portainer and create the file docker-compose.yml.

    cd /mnt/nasdrive/portainer && touch docker-compose.yml

    4. Here’s my configure docker-compose.yml.

    version: '3.3'
    services:
      portainer:
        image: portainer/portainer-ce:latest
        container_name: portainer
        ports:
          - 8000:8000
          - 9443:9443
        networks:
          - nginx
        command: -H unix:///var/run/docker.sock
        restart: always
        volumes:
          - /var/run/docker.sock:/var/run/docker.sock
          - /mnt/nasdrive/portainer/data:/data
    networks:
      nginx:
       external: true

    5. Now that the Portainer is up and running, we can start to use it. To make my site secure and HTTPS with let’s encrypt, we need to create Let’s encrypt on Portainer. I already have and made an account. You should expect to see a first time creation of an account. https://yourIP:port

    Now, you can log in to Portainer to start creating a docker nginx proxy manager.

    Step 2 – setting up nginx proxy manager

    1. After selecting the Server for your initial Portainer Docker, you will notice the option “Stacks” on the front page of Portainer. To add a stack, click the blue button.

    2. You can choose any name you want, but it’s helpful for me to keep things organized. We made a program called nginx__. I use compose docker configure, but we have MariaDB Database separate docker compose because I want to use one database for all my General apps. If you desire to utilize the MariaDB database, the following tutorial provides guidance on setting up the database on Portainer.

    version: '3.8'
    services:
      app:
        container_name: nginx
        image: 'jc21/nginx-proxy-manager:latest'
        restart: unless-stopped
        networks:
          - nginx
          - mariadb
        ports:
          - target: 443
            published: 443 # Outside port
            mode: host
            protocol: tcp
          - target: 80
            published: 80 # Outside port
            mode: host
            protocol: tcp
          - target: 81
            published: 81
            mode: host
            protocol: tcp
        environment:
          # Mysql/Maria connection parameters:
          DB_MYSQL_HOST: "mariadb"
          DB_MYSQL_PORT: 3306
          DB_MYSQL_USER: "npm"
          DB_MYSQL_PASSWORD: "Password"
          DB_MYSQL_NAME: "npm"
          # Uncomment this if IPv6 is not enabled on your host
          DISABLE_IPV6: 'true'
          TZ: 'America/Los_Angeles'
        volumes:
          - /mnt/nasdrive/nginx/data:/data
          - /mnt/nasdrive/nginx/letsencrypt:/etc/letsencrypt
    networks:
      nginx:
        external: true
      mariadb:
        external: true

    I already created a MariaDB database and a user for the NGINX proxy manager. So easy with PhpMyAdmin method instead, terminal console. Learn more about set up PhpMyAdmin!

    3. Launching the stack for nginx!

    Now open the Docker Nginx Proxy Manager at http://yourIP:81.

    There is a default login because there is no creation page for users.

    Email: admin@example.com Password: changeme
    Immediately after logging in with this default user, you will be asked to modify your details and change your password.

    After you change the password and Username you set, then now you should see this:

    You should be said “0 Proxy Hosts”. I just have many domains here to use all my apps.

    Now you can open the Proxy hosts to make HTTPS certificates for NGINX proxy manager and Portainer.

    Nginx Proxy Manager – Nginx Proxy Host Detail

    This for Nginx proxy Manager. That form you should fill out. Just a reminder, the Forward hostname/IP can work with docker-compose “container_name: nginx”.
    You see docker-compose.yml have container_name: that you create, and container_name needs to be on form where is Forward Hostname/IP. So that way this machine can communicate with container_name to more secure because never know IP changed.
    Last, for nginx proxy Manager – Force SSL and HTTP2 and HSTS need to be enabled.
    Now, our sites are secure, and you have to remove port 81 on docker-compose to secure our HTTP. We will never expose 80 or 81, but our nginx proxy manager needs port 80 for Let’s Encrypt. So, we leave port for 80 and 443 on our docker-compose.yml.

    Portainer – Nginx Proxy Host Detail

    Portainer – scheme for HTTPS and port for 9443 and make sure you enable block common exploits and Web sockets support.
    Portainer – you will need to enable SSL and HTTP/2 and HSTS.

    Advanced custom nginx configurations won’t be needed anymore. Then now your Portainer and NGINX are secured!

    HTTPS on Portainer sites. 🙂

    I recommend you all to force HTTPS only on private network too. It’s really safe. So, the Portainer itself app will not work with the HTTP port anymore.

    Portainer ⇾ settings ⇾ scroll down until you see SSL Certificate

  • My Beautiful Cats

  • My Honda Civic got a break in at YMCA near North Pearl

    On May 4th 2017, my back windows door was crack and break in by hammer.. so I went back YMCA where is employee is, and they want vaccum for me and tape for me while i replace windows.

    May 10 2017 6 days later, after replacing windows, windows are worth $15 from pick n pull junk yard, and I did replace it by myself.