Skip to main content

Setting up Apache Guacamole using Docker

The IP of my docker server is 192.168.10.11

Step 1: sudo docker run --name my-guacd -d guacamole/guacd

Step 2: sudo docker run --name guacamole-mysql -e MYSQL_ROOT_PASSWORD=sqlpassword -d --restart unless-stopped mysql:latest

Step 3: sudo docker exec -it guacamole-mysql /bin/bash

mysql -u root -p

CREATE DATABASE guacamole_db;
CREATE USER 'guacamole_user'@'%' IDENTIFIED BY 'guacamopwd';
GRANT ALL PRIVILEGES ON guacamole_db.* TO 'guacamole_user'@'%';
FLUSH PRIVILEGES;

Exit out of the mysql docker

Step 4:

sudo docker run --rm guacamole/guacamole /opt/guacamole/bin/initdb.sh --mysql > initdb.sql

sudo cat initdb.sql | sudo docker exec -i guacamole-mysql /usr/bin/mysql -u guacamole_user -pguacamopwd -D guacamole_db

note: there is no space between -p and guacamopwd (the actual password)

Step 5:

sudo docker run --name my-guacamole \
--link my-guacd:guacd \
--link guacamole-mysql:mysql \
-e WEBAPP_CONTEXT=ROOT \
-e MYSQL_HOSTNAME=192.168.10.11 \
-e MYSQL_DATABASE=guacamole_db \
-e MYSQL_USER=guacamole_user \
-e MYSQL_PASSWORD=guacamopwd \
-e TOTP_ENABLED=true \
--restart unless-stopped \
-d -p 8080:8080 guacamole/guacamole

Check that quacamole is running: sudo docker logs my-guacamole

Default admin login is guacadmin/guacadmin

Reference:Visit: https://guacamole.github.com/boschkundendienst/guacamole-docker-compose

Follow instructions which in short are:

    git clone "https://github.com/boschkundendienst/guacamole-docker-compose.git" cd guacamole-docker-compose Edit docker-compose.yml to suite your environment ./prepare.sh docker compose up -d

    If you want to add TOTP then do the following:

       In your docker-compose.yml file add
        Environment variable: GUACAMOLE_HOME=/config/guacamole Mount ./guacamole:/config/guacamole Create in your docker directory
          create the folllowing folders guacamole/extensions/ wget https://downloads.apache.org/doc/gug/guacamole/1.6.0/binary/guacamole-docker.htmlauth-totp-1.6.0.tar.gz (or matching version to your guacamole install) and extract the guacamole-auth-totp-1.6.0.jar to the above extensions folder

          After adding the above extension, restart the container.