Docker Hub:
GitHub:
Credits:
Before you are able to fully use this Docker-Compose file, you will need to manually initialize the PostgreSQL database by following these instructions: https://guacamole.apache.org/doc/gug/guacamole-docker.html#guacamole-docker-postgresql
I performed the following (Note: If trying to follow the official linked documentation - we are creating the “guacamole_db” database and “guacamole_user” user [and setting the password] via the postgres environment variables in the Docker-Compose file instead of doing so manually as the official documentation says to do):
$ docker run --rm guacamole/guacamole /opt/guacamole/bin/initdb.sh --postgres > initdb.sql
.$ docker-compose up -d postgres
and moved the “initdb.sql” file to the “postgres_data” directory that was created with $ sudo mv initdb.sql postgres_data/
.$ docker-compose exec postgres /bin/bash
and then changed directory to the location containing “initdb.sql” with $ cd /var/lib/postgresql/data
.$ psql -U guacamole_user -d guacamole_db -f initdb.sql
.$ psql -U guacamole_user -d guacamole_db
, followed by running the following commands in sequence:GRANT SELECT,INSERT,UPDATE,DELETE ON ALL TABLES IN SCHEMA public TO guacamole_user;
GRANT SELECT,USAGE ON ALL SEQUENCES IN SCHEMA public TO guacamole_user;
\q
$ exit
out of the container, and started the stack with $ docker-compose up -d
. I could then access my new Guacamole instance at http://local_ip_address:8080/guacamole
. The default username and password are both guacadmin
.---
version: "3"
services:
guacamole:
image: guacamole/guacamole
container_name: guacamole
environment:
- GUACD_HOSTNAME=guacd
- GUACD_PORT=4822
- POSTGRES_HOSTNAME=postgres
- POSTGRES_PORT=5432
- POSTGRES_DATABASE=guacamole_db
- POSTGRES_USER=guacamole_user
- POSTGRES_PASSWORD=YOUR_POSTGRES_PASSWORD
ports:
- 8080:8080
restart: unless-stopped
guacd:
image: guacamole/guacd
container_name: guacd
restart: unless-stopped
postgres:
image: postgres:13
container_name: postgres
environment:
- POSTGRES_DB=guacamole_db
- POSTGRES_USER=guacamole_user
- POSTGRES_PASSWORD=YOUR_POSTGRES_PASSWORD
volumes:
- ./postgres_data:/var/lib/postgresql/data
restart: unless-stopped