Docker Compose File for Apache Guacamole


Last modified: 13.12.2020
estimated reading time 1 min

This file can also be used to create a Container-Station App on a QNAP NAS.

Apache Guacamole provides easy, seamless and clientless access to remote desktops via vnc, rdp or ssh.
Ensure that you adapt the file to your environment.

version: "2.1"
    image: linuxserver/guacd
    container_name: guacd
      - 4822:4822
    restart: unless-stopped

# Guacamole - Remote desktop, SSH, on Telnet on any HTML5 Browser 
# Create all databases and tables first
    image: guacamole/guacamole:latest
    container_name: guacamole
    restart: unless-stopped
      - 8070:8080
      GUACD_HOSTNAME: guacd
      MYSQL_PORT: 3306
      MYSQL_DATABASE: guacamole
      MYSQL_USER: <dbuser>
      MYSQL_PASSWORD: <dbpassword>

This Container uses a MySQL Database on a separate host, which has to be created and initialized manually as explained below. I do this, as I already have a MariaDB Server running on my Synology NAS that I use for this.

Create Guacamole Initialization Script

Guacamole requires that the database be initialized first. This involves several steps. However, Guacamole provides a script that can simplify this process. From your host system’s commandline, run this command to create the initialization script.

docker run --rm guacamole/guacamole /opt/guacamole/bin/ --mysql > guac_initdb.sql

Now please create the database, create the database user, grant the user access to the database.

mysql -u root -p
create database guacamole;
CREATE USER 'guacdb_user' IDENTIFIED BY 'my_strong_password';
GRANT ALL ON `guacamole%`.* TO 'guacdb_user';
flush privileges;

Finally initialize the database like this:

cat guac_initdb.sql | /usr/local/mariadb10/bin/mysql -u guacdb_user -p guacamole;

You should now be able to access guacamole http://IPofHost:8070/guacamole/

The default login is:
password: guacadmin

Was this article helpful?
Dislike 0
Views: 92