Category: Linux Server

  • 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 It to Your Nextcloud Docker Network


    If you’re self-hosting Nextcloud using Docker, integrating Redis as a caching and file locking service is a must for better speed and reliability. Portainer makes managing Docker super easy, especially with its user-friendly “Stacks” feature. In this post, you’ll learn step by step how to:

    • Deploy Redis using Portainer Stacks
    • Connect the Redis container to the network used by your Nextcloud instance (for simple, secure communication)
    • Update your Nextcloud config to use Redis

    Let’s get started!


    Prerequisites

    • Docker & Docker Compose installed and running
    • Portainer up and accessible (http://your-server:9000)
    • A Nextcloud stack/container already running on Docker
    • Portainer has permissions to manage your Docker host

    Step 1: Identify (or Create) the Nextcloud Docker Network

    First, Nextcloud and Redis need to be on the same Docker network so they can talk.

    Find the Network Name

    If you deployed Nextcloud as a Portainer stack, you likely have a custom network. To check:

    1. In Portainer, go to Containers and find your Nextcloud container.
    2. Click on it and look for the Network section.

    The network name may look like nextcloud_default (if your stack is named ‘nextcloud’). Take note of it!

    If not found, you can always create a network manually:

    docker network create nextcloud-net

    Step 2: Create a Redis Stack in Portainer

    1. In Portainer, go to Stacks > Add Stack
    2. Name your stack, e.g., redis
    3. Use the following example docker-compose file:
    version: '3.7'
    
    services:
      redis:
        image: redis:alpine
        container_name: redis
        restart: unless-stopped
        networks:
          - nextcloud_network
        # For persistent storage (optional):
        # volumes:
        #   - redis-data:/data
    
    # Define external network (replace with your actual network name)
    networks:
      nextcloud_network:
        external: true
    
    # Uncomment for persistent volume (optional)
    # volumes:
    #   redis-data:

    Important:
    Change nextcloud_network to your Nextcloud network name (from Step 1), e.g., nextcloud_default.

    1. Click Deploy the stack

    Step 3: Confirm Redis is Running & Networked

    In Containers, check that the redis container is running and attached to the correct network.
    You should see both nextcloud and redis containers under the same network.


    Step 4: Add Redis Configuration to Nextcloud

    SSH into your Nextcloud server or use Portainer’s console and add the following to your config/config.php for Nextcloud (usually found in the nextcloud/config/ directory):

    'memcache.local' => '\\OC\\Memcache\\APCu',
    'memcache.locking' => '\\OC\\Memcache\\Redis',
    'redis' => [
       'host' => 'redis',       // the service name from your stack
       'port' => 6379,
       // 'password' => 'yourpassword', // If you set one
       'timeout' => 0.0,
    ],
    • If you gave your redis container a different name, adjust 'host' => 'redis' accordingly.
    • If you set a redis password (not done in this example, but recommended for production!), include the 'password' line.

    Step 5: Restart Nextcloud Container

    You can do this in Portainer via the container menu (Actions > Restart), or with:

    docker restart <nextcloud-container-name>

    Troubleshooting

    • If Nextcloud can’t connect to Redis, double-check:
    • Both containers are on the same Docker network
    • host matches the Redis container’s service/container name (not localhost or 127.0.0.1)
    • No firewall is blocking Docker internal traffic
    • Use Portainer’s logs for debugging (redis and nextcloud containers)

    Conclusion

    With just a few edits and a quick stack deployment in Portainer, you can power up your Nextcloud setup with Redis for better performance, safer file locking, and future-proof scaling. Let Portainer do the heavy lifting—no need to wrangle the command line!

    Have questions or run into issues? Drop them below or check the Nextcloud docs for more tips.


    Happy self-hosting!


    Please let me know if you’d like examples for persistent volumes, securing Redis, or extra performance tuning!

Secret Link