According to the Guacamole Manual Chapter 3. Installing Guacamole with Docker.
As linking container is not supported since docker-compose v2.1 the guacamole services configuration is done using environment variables.
In the docker-compose.yml services share the same .env file.
Create the .env file in the root of the project, don't forget changing the POSTGRES_PASSWORD:
#guacd
GUACD_HOSTNAME=guacd
#GUACD_PORT=4822
#
#Database settigs
POSTGRES_USER=guacamole
POSTGRES_PASSWORD=secretdbpassword
PGDATA=/var/lib/postgresql/db
POSTGRES_DB=guacamole
POSTGRES_DATABASE=guacamole
POSTGRES_HOSTNAME=sql
#POSTGRES_PORT=5432It is PostgreSQL and the official postgres docker image is used as gucacmole's authentication mechanism.
In the envirnment POSTGRES_DB is used by the posgrges container, POSTGRES_DATABASE is for guacaole/guacamole container, and must be the same.
Before the first usage the guacamole database must be initialized. The docker-initdb.yml is for initializing the posgrges db.
You may want editing volumes in docker-compose.yml and docker-initdb.yml. The db volume must be the same.
First, update the sql script:
docker run --rm guacamole/guacamole /opt/guacamole/bin/initdb.sh --postgres > initdb.d/initdb.sqlthen initialize the database
docker-compose -f docker-initdb.yml up(terminate the container when initialization completes).
Starting guacamole gateway is trivial:
docker-compose up -dAccording to the documentation
Once the Guacamole image is running, Guacamole should be accessible at
http://HOSTNAME:8080/guacamole/, whereHOSTNAMEis the hostname or address of the machine hosting Docker, and you should a login screen. If using MySQL or PostgreSQL, the database initialization scripts will have created a default administrative user called "guacadmin" with the password "guacadmin".
If you wish using HAProxy as the gateway - un-comment the external web: network in the guacamole service in the docker-compose.yml.
The haproxy_default network has to be pre-defined, for eg.:
docker network create -d bridge \
--subnet=172.15.0.0/16 \
--gateway=172.15.0.1 \
haproxy_defaultI prefer using bringnow/docker-haproxy-letsencrypt, see the sample haproxy.cfg with guacamole backend and https termination.
According to this configuration guacamole is accessible at https://example.tld/guacamole/.