Apache Guacamole (Docker) on Debian 12 (Nginx + SSL)

Apache Guacamole is a clientless remote desktop gateway that supports RDP, VNC, and SSH — all accessible directly through a modern web browser. Because it’s based on HTML5, no plugins or client software are required: users can securely connect to desktops and servers from anywhere with just a browser.

Running Guacamole in Docker bundles all components (the Guacamole web app, the guacd proxy daemon, and optional database support) into containers, simplifying deployment and maintenance. With Debian 12 (Bookworm) as the host operating system, you gain the advantages of long-term stability, security updates, and a rock-solid Linux foundation that is widely trusted for production use.


Architecture Overview

LayerComponentRole
OSDebian 12 (Bookworm)Stable, secure base; systemd service supervision
RuntimeDocker EngineRuns Guacamole and supporting containers
ApplicationApache Guacamole (Web UI)Browser-based remote desktop gateway
Proxy Daemonguacd (in container)Handles RDP, VNC, SSH protocols and streams them to the web client
DatabasePostgreSQL/MySQL (optional)Stores users, roles, and connection configs (persistent setups)
Reverse ProxyNginx (recommended)TLS termination, HTTP/2, authentication, access control
TLSLet’s Encrypt / PKIProvides secure HTTPS access

Why Use Apache Guacamole?

  • Clientless – works entirely in the browser; no plugins or agents needed.
  • Multi-protocol support – RDP, VNC, and SSH out of the box.
  • Centralized access – manage multiple desktops and servers from a single portal.
  • Enterprise-grade security – HTTPS, role-based permissions, optional MFA.
  • Containerized deployment – easy to set up, upgrade, and move between hosts.

Guacamole vs Other Remote Access Solutions

Feature/CapabilityApache GuacamoleVPN-only AccessProprietary Tools (AnyDesk, NoMachine)Native RDP/VNC Clients
Client requirementsNone (HTML5 browser)VPN clientProprietary app requiredRDP/VNC client needed
Protocols supportedRDP, VNC, SSHNetwork-level onlyCustom / limitedRDP or VNC only
Multi-user managementYes (RBAC, DB backend)NoLimitedNo
SecurityTLS, Nginx, RBACVPN encryption onlyVendor-dependentBasic protocol security

Guacamole excels when you want centralized, browser-based remote access that works across devices without installing any additional software.


Security & Best Practices

  • Deploy Guacamole behind Nginx with SSL for encrypted browser access.
  • Use Let’s Encrypt or a corporate PKI for certificates.
  • Restrict exposure with Debian firewall rules (UFW/nftables).
  • Store accounts and permissions in PostgreSQL or MySQL for persistence.
  • Enable MFA or SSO where possible.
  • Keep Docker images (guacamole/guacd and guacamole/guacamole) up to date.
  • Use Fail2Ban/rate limiting on Nginx to prevent brute-force attempts.

Typical Use Cases

  • A remote desktop gateway for teams and sysadmins.
  • Secure browser-based SSH access to Linux servers.
  • Centralized management of Windows RDP desktops.
  • Lightweight alternative to VPN-only setups.
  • Safe BYOD (Bring Your Own Device) access to internal systems.

1. Create a Shape.Host VPS Instance

Go to https://shape.host and log in.

Click “Create” → “Instance”.

Shape.host Resources dashboard with Create > Instance highlighted.

Select the server location closest to your users.

Shape.host instance form with the data center location selector highlighted.

Choose Debian 12 (64-bit) as the operating system.

Pick a plan with at least 2 CPUs, 4 GB RAM, and 20 GB SSD.

Shape.host instance form with the operating system image selector highlighted.

Click “Create Instance”.

Shape.host instance form with the Create Instance button highlighted.

Copy the IP address of your VPS from the Resources section.

Shape.host Resources dashboard with the server IP address highlighted.

2. Connect to Your VPS

On Linux/macOS

ssh root@your-server-ip

On Windows

  • On Windows 10/11, use PowerShell: ssh root@your-server-ip
  • On older Windows, download PuTTY, enter your server’s IP, and log in as root.

3. Update System and Install Prerequisites

apt update
apt upgrade
Terminal showing APT package management commands and output.

Updates system packages.

apt install ca-certificates curl gnupg lsb-release

Installs required tools for secure repositories.

Terminal showing APT package management commands and output.

4. Install Docker and Docker Compose

Create directory for Docker keyrings:

install -m 0755 -d /etc/apt/keyrings

Add Docker’s GPG key:

curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg

Add Docker repository:

echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list

Update and install Docker:

apt update
apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Terminal showing APT package management commands and output.
Terminal showing APT package management commands and output.

Enable and start Docker:

systemctl enable --now docker

Check versions:

docker --version
docker compose version
Terminal showing the installed Docker Compose version.

5. Create Guacamole Docker Setup

Create a working directory:

mkdir -p /opt/guacamole
cd /opt/guacamole

Create the docker-compose.yml file:

nano docker-compose.yml
Terminal showing file and directory setup commands.

Paste the following content:

services:
  guacamole-db:
    image: postgres:15
    container_name: guac-db
    environment:
      POSTGRES_USER: guacuser
      POSTGRES_PASSWORD: StrongPassword123!
      POSTGRES_DB: guacamole_db
    volumes:
      - db_data:/var/lib/postgresql/data
    restart: unless-stopped

  guacd:
    image: guacamole/guacd:1.5.5
    container_name: guacd
    restart: unless-stopped

  guacamole:
    image: guacamole/guacamole:1.5.5
    container_name: guacamole
    environment:
      POSTGRES_HOSTNAME: guacamole-db
      POSTGRES_DATABASE: guacamole_db
      POSTGRES_USER: guacuser
      POSTGRES_PASSWORD: StrongPassword123!
      GUACD_HOSTNAME: guacd
      GUACD_PORT: 4822
    ports:
      - "8080:8080"
    depends_on:
      - guacamole-db
      - guacd
    restart: unless-stopped

volumes:
  db_data:
Terminal showing the GNU nano editor and configuration text.

6. Initialize PostgreSQL Database for Guacamole

Start the database container:

docker compose up -d guacamole-db

Wait for PostgreSQL to initialize:

sleep 10
Terminal showing container image download progress.

Generate SQL schema for Guacamole:

docker run --rm guacamole/guacamole:1.5.5 /opt/guacamole/bin/initdb.sh --postgresql > initdb.sql

Import schema into the database:

docker exec -i guac-db psql -U guacuser -d guacamole_db < initdb.sql
Terminal showing SQL database import commands.

Verify tables were created:

docker exec -it guac-db psql -U guacuser -d guacamole_db -c "\dt"
Terminal showing docker commands or output during Initialize PostgreSQL Database for Guacamole.

7. Start Guacamole Services

Start all containers:

docker compose up -d

Check status:

docker compose ps

Check logs:

docker logs guacamole --tail=100
Terminal showing container image download progress.

Now you can access Guacamole at:

http://<server-ip>:8080/guacamole

Default login:

  • Username: guacadmin
  • Password: guacadmin

Change this password immediately after first login.

Guacamole sign-in form.

8. Configure Nginx Reverse Proxy

Install Nginx:

apt install nginx
Terminal showing APT package management commands and output.

Create configuration file:

nano /etc/nginx/conf.d/guacamole.conf

Paste:

server {
    listen 80;
    server_name debian-tutorials.shape.host;

    location / {
        proxy_pass http://127.0.0.1:8080/guacamole/;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        # WebSockets required for RDP/VNC
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 3600s;
    }
}
Terminal showing web server configuration text.

Fix hash bucket size (avoids Nginx errors with long domain names):

printf "server_names_hash_bucket_size 128;\n" > /etc/nginx/conf.d/hash_bucket.conf

Test and reload Nginx:

nginx -t && systemctl reload nginx

9. Enable SSL with Let’s Encrypt

Install Certbot:

apt install certbot python3-certbot-nginx
Terminal showing APT package management commands and output.

Request SSL certificate:

certbot --nginx -d debian-tutorials.shape.host
Terminal showing Certbot certificate commands and messages.

10. Access Guacamole

Now open your browser and visit:

https://debian-tutorials.shape.host

Log in with the default credentials, then update the admin password.

Guacamole sign-in form.
Guacamole connection list.

This tutorial was created and tested on a Shape.Host Linux SSD VPS.

With Shape.Host you can:

  • Deploy fast VPS servers worldwide
  • Choose Debian, Ubuntu, AlmaLinux, or Rocky Linux
  • Scale resources instantly (CPU, RAM, Storage)
  • Use snapshots, backups, and monitoring

Start today at https://shape.host and set up Apache Guacamole in minutes.