Field guide
Browser-based remote access with Apache Guacamole
Most small networks support remote work one of two ways: RDP forwarded straight off the router, or a different remote tool installed on every machine. A forwarded RDP port is found by scanners within hours, and the only thing between an attacker and a desktop is a password. The per-machine tools avoid that but hand several vendors access to the network and a licence to pay per seat, forever.
Apache Guacamole replaces both. One hardened gateway at the edge, everything else stays private, and users get a desktop or shell in a browser tab with nothing installed.
This is the whole deployment, start to finish.
What you need before starting
- A VM for the gateway. 2 vCPU and 2 GB RAM handles a small office comfortably.
- A domain name with an A record pointing at it.
- Root access over SSH.
- The machines you want to reach, answering on RDP (3389), VNC (5900) or SSH (22) on the private network only.
1Prepare the server
Update the base system:
apt update && apt upgrade -y
Set the hostname to the name people will actually type:
hostnamectl set-hostname remote.example.com
Confirm DNS resolves here before going any further. If this is empty or wrong, the certificate step later fails with an error that does not explain itself:
dig +short remote.example.com
2Install Docker
curl -fsSL https://get.docker.com | sh
Check the daemon is up:
docker --version && systemctl is-active docker
3Start guacd
Guacamole is two pieces. guacd is the proxy daemon that actually speaks RDP, VNC and SSH; the web application is a separate container that talks to it. Start the daemon first, on an internal Docker network so nothing else can reach it:
docker network create guac-net
docker run -d \
--name guacd \
--restart unless-stopped \
--network guac-net \
guacamole/guacd:latest
4Start the database
Guacamole keeps users, connections and permissions in a database. MariaDB is the usual choice:
docker run -d \
--name guac-db \
--restart unless-stopped \
--network guac-net \
-e MYSQL_RANDOM_ROOT_PASSWORD=yes \
-e MYSQL_DATABASE=guacamole_db \
-e MYSQL_USER=guacamole_user \
-e MYSQL_PASSWORD=CHANGE_THIS_PASSWORD \
-v guac-db-data:/var/lib/mysql \
mariadb:11
The named volume matters. Without it, your entire user and connection list disappears the first time the container is recreated.
5Load the database schema
The Guacamole image generates its own schema. Write it out to a file:
docker run --rm guacamole/guacamole:latest /opt/guacamole/bin/initdb.sh --mysql > initdb.sql
Check it actually produced something before loading it — a zero-length file here is the most common reason the next step appears to work and then nothing logs in:
wc -l initdb.sql
Load it. The password is read from the container's own environment, so it never appears on the command line or in shell history:
docker exec -i guac-db sh -c 'MYSQL_PWD="$MYSQL_PASSWORD" mariadb -u "$MYSQL_USER" "$MYSQL_DATABASE"' < initdb.sql
6Start the web application
Bind it to localhost only. Nothing should reach it except the reverse proxy in step 7:
docker run -d \
--name guacamole \
--restart unless-stopped \
--network guac-net \
-p 127.0.0.1:8080:8080 \
-e GUACD_HOSTNAME=guacd \
-e MYSQL_HOSTNAME=guac-db \
-e MYSQL_DATABASE=guacamole_db \
-e MYSQL_USER=guacamole_user \
-e MYSQL_PASSWORD=CHANGE_THIS_PASSWORD \
guacamole/guacamole:latest
Confirm it answers locally:
curl -I http://127.0.0.1:8080/guacamole/
7Reverse proxy and HTTPS
apt install -y nginx python3-certbot-nginx
nano /etc/nginx/sites-available/guacamole
Paste this, changing the domain. The WebSocket upgrade headers are what carry the remote display — without them the interface loads and every connection attempt dies at "connecting":
server {
listen 80;
server_name remote.example.com;
location / {
proxy_pass http://127.0.0.1:8080/guacamole/;
proxy_buffering off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
access_log off;
}
}
Enable it and drop the default site:
ln -s /etc/nginx/sites-available/guacamole /etc/nginx/sites-enabled/
rm -f /etc/nginx/sites-enabled/default
Always test before reloading — a syntax error takes the whole server down:
nginx -t && systemctl reload nginx
Get the certificate:
certbot --nginx -d remote.example.com
Confirm renewal works now rather than in ninety days:
certbot renew --dry-run
8Close the firewall
SSH first, then web traffic. Enabling the firewall before SSH is allowed locks you out of the server, and the only way back in is the provider's console:
ufw allow 22/tcp
ufw allow 80/tcp
ufw allow 443/tcp
ufw --force enable
ufw status numbered
9First login and lock down the admin
Open https://remote.example.com and sign in with the stock credentials:
the default guacadmin account (its starting password is in the Guacamole documentation)
Do these three things immediately, before anything else:
- Create your own administrator account with a real password.
- Log in as that new account.
- Delete the
guacadminaccount. Changing its password is not enough; every scanner on the internet knows that username.
10Add connections
Under Settings - Connections - New Connection, one per machine:
- Name — what the user will see in their list.
- Protocol — RDP, VNC or SSH.
- Hostname — the machine's private address. The gateway reaches it; the internet does not.
- Port — 3389 for RDP, 22 for SSH.
- For RDP, set Security mode to
NLAand tick Ignore server certificate for machines using self-signed certificates, which is most of them on a LAN.
Use groups rather than granting each user each machine individually. Adding a person then becomes one action instead of fifteen.
11Turn on two-factor
This is the front door to every machine you own, so a password alone is thin. Guacamole ships a TOTP extension:
docker exec guacamole ls /opt/guacamole/extensions-available/
Enable it by recreating the container with the extension listed. Each user is then prompted to enrol an authenticator app at their next login:
docker rm -f guacamole
Then re-run the docker run command from step 6, adding this line before the image name:
-e EXTENSIONS=auth-totp \
12Back up and keep it running
The database holds every user, connection and permission you just configured. The password is read from the container's environment, so it never appears on the command line or in shell history. The dump holds every user's login details, so keep it off this server or encrypt it. Back it up on a schedule:
docker exec guac-db sh -c 'MYSQL_PWD="$MYSQL_PASSWORD" mariadb-dump -u "$MYSQL_USER" "$MYSQL_DATABASE"' > guac-backup-$(date +%F).sql
chmod 600 guac-backup-*.sql
Test the restore into a second test installation, never the live one, using the load command from step 5 pointed at a backup file:
docker exec -i guac-db sh -c 'MYSQL_PWD="$MYSQL_PASSWORD" mariadb -u "$MYSQL_USER" "$MYSQL_DATABASE"' < guac-backup-YYYY-MM-DD.sql
An untested backup is a rumour.
To update, pull and recreate — nothing of yours lives inside the containers, only in the database volume:
docker pull guacamole/guacamole:latest && docker pull guacamole/guacd:latest
Confirm everything comes back by itself after a reboot:
docker ps --format '{{.Names}}\t{{.Status}}'
The part people actually notice
Everything above is the standard deployment and it works. What people notice in daily use is how awkward a desktop inside a browser tab becomes on a tablet:
- A touch device has no physical keyboard, and the tablet's own on-screen keyboard belongs to the browser, not to the remote session. Modifier keys, function keys and combinations like Ctrl+Alt+Del either do not exist or go to the wrong place.
- Entering and leaving fullscreen means hunting through a menu, which is fiddly enough on a touch screen that people simply stop doing it.
So we add two things to the interface.
A proper on-screen keyboard for the session — one that sends keystrokes into the remote machine rather than to the browser, with the modifiers and function keys support work actually needs.
A fullscreen control on the edge of the session, within thumb reach, that toggles without leaving the desktop or hunting for a menu.
Small changes. They are the difference between a tablet being a usable way to work and being abandoned after a week.



These two are our own work and are not covered above — the steps in this guide get you a working stock gateway.
Troubleshooting
Login page loads, credentials rejected. The schema did not load. Re-check step 5; wc -l initdb.sql should be thousands of lines, not zero.
Connection hangs at "connecting". WebSocket upgrade headers missing from the Nginx config. See step 7.
"The remote desktop server is currently unreachable." The gateway cannot see the target on the private network. Test from the gateway itself with nc -vz <host> 3389.
RDP fails instantly on a LAN machine. Certificate rejection. Set security mode to NLA and ignore the server certificate.
Everything worked, now nothing logs in after a rebuild. The database volume was dropped. This is why step 4 uses a named volume.
Want this set up for you? The deployment, the hardening, and the tablet interface work are all things we do. Get in touch and describe the network — how many machines, how many people, and whether tablets are part of the picture.