Guacamole docker compose: Difference between revisions

From wiki karavi
Jump to navigation Jump to search
(Created page with " Create the ${HOME}/docker-stack/guacamole/docker-compose.yml file: # networks # create a network 'guacnetwork_compose' in mode 'bridged' networks: guacnetwork_compose: driver: bridge # services services: # guacd guacd: container_name: guacd_compose image: guacamole/guacd networks: - guacnetwork_compose restart: always volumes: - ./drive:/drive:rw - ./record:/record:rw # postgres postgres: contai...")
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
Create a folder that will contain the different files and folders for our Guacamole environment…
mkdir guacamole


In the “guacamole” folder, create the “docker-compose.yml” file…
touch docker-compose-yml


Create the ${HOME}/docker-stack/guacamole/docker-compose.yml file:
Now open “docker-compose.yml” for editing…
nano docker-compose.yml


# networks
Here is the content of the “docker-compose.yml” file, adapt it to your environment…
  # create a network 'guacnetwork_compose' in mode 'bridged'
  version: '3.8'
networks:
  guacnetwork_compose:
    driver: bridge
   
   
# services
  services:
  services:
  # guacd
    guacamole_db:
  guacd:
        container_name: guacamole_db
    container_name: guacd_compose
        hostname: guacamole_db
    image: guacamole/guacd
        image: mariadb:10.11
    networks:
        restart: always
      - guacnetwork_compose
        volumes:
    restart: always
            - ./guacamole_db:/var/lib/mysql
    volumes:
        environment:
    - ./drive:/drive:rw
            - MYSQL_ROOT_PASSWORD=blablalinux
    - ./record:/record:rw
            - MYSQL_DATABASE=guacamole_db
  # postgres
            - MYSQL_USER=anyblabla
  postgres:
            - MYSQL_PASSWORD=blabla
    container_name: postgres_guacamole_compose
        expose:
    environment:
            - 3306
      PGDATA: /var/lib/postgresql/data/guacamole
      POSTGRES_DB: guacamole_db
      POSTGRES_PASSWORD: 'ChooseYourOwnPasswordHere1234'
      POSTGRES_USER: guacamole_user
    image: postgres:15.2-alpine
    networks:
      - guacnetwork_compose
    restart: always
    volumes:
    - ./init:/docker-entrypoint-initdb.d:z
    - ./data:/var/lib/postgresql/data:Z
   
   
  # guacamole
    guacd:
  guacamole:
        container_name: guacd
    container_name: guacamole_compose
        hostname: guacd
    group_add:
        image: guacamole/guacd:latest
      - "1000"
        restart: always
    depends_on:
        volumes:
    - guacd
            - ./guacd_drive:/drive:rw
    - postgres
            - ./guacd_record:/record:rw
    environment:
        expose:
      GUACD_HOSTNAME: guacd
            - 4822
      POSTGRES_DATABASE: guacamole_db
      POSTGRES_HOSTNAME: postgres
    guacamole:
      POSTGRES_PASSWORD: 'ChooseYourOwnPasswordHere1234'
        container_name: guacamole
      POSTGRES_USER: guacamole_user
        hostname: guacamole
      RECORDING_SEARCH_PATH: /record
        restart: always
    image: guacamole/guacamole
        image: guacamole/guacamole:latest
    networks:
        depends_on:
      - guacnetwork_compose
            - guacamole_db
    volumes:
            - guacd
      - ./record:/record:rw
        ports:
    ports:
            - 8080:8080
  ## enable next line if not using nginx
        links:
  #    - 8086:8080/tcp # Guacamole is on :8080/guacamole, not /.
            - guacd
  ## enable next line when using nginx
        environment:
    - 8080/tcp
            - GUACD_HOSTNAME=guacd
    restart: always
            - MYSQL_HOSTNAME=guacamole_db
            - MYSQL_DATABASE=guacamole_db
            - MYSQL_USER=anyblabla
            - MYSQL_PASSWORD=blabla
            - REMOTE_IP_VALVE_ENABLED=true
 
In “environment” of the “guacamole_db” service…
 
Don't forget to customize the “root” password for MySQL…
 
  - MYSQL_ROOT_PASSWORD=blablalinux
 
Don't forget to customize the username for MySQL…
 
- MYSQL_USER=anyblabla
 
Don't forget to customize the password for MySQL…
 
- MYSQL_PASSWORD=blabla
 
The “environment” information of the “guacamole_db” service must be the same as the “environment” information of the “guacamole” service!
 
 
The variable “- REMOTE_IP_VALVE_ENABLED=” must be activated if you are using a reverse proxy …
 
  - REMOTE_IP_VALVE_ENABLED=true
 
To enable two-factor authentication , simply add this variable below the variable “- REMOTE_IP_VALVE_ENABLED=true”…
 
- TOTP_ENABLED=true
 
 
The default username and password is: guacadmin
 
 
You can start the container!
docker-compose up -d
 
 
 
Manual/Portainer - Common Instructions
sudo su
docker run --rm guacamole/guacamole /opt/guacamole/bin/initdb.sh --mysql > initdb.sql
  docker exec -i guacamole_db mysql --user anyblabla --password=blabla guacamole_db < initdb.sql
 
The order must be adapted to your environment…
--user anyblabla --password=blabla

Latest revision as of 19:12, 30 March 2025

Create a folder that will contain the different files and folders for our Guacamole environment…

mkdir guacamole

In the “guacamole” folder, create the “docker-compose.yml” file…

touch docker-compose-yml

Now open “docker-compose.yml” for editing…

nano docker-compose.yml

Here is the content of the “docker-compose.yml” file, adapt it to your environment…

version: '3.8'

services:
    guacamole_db:
        container_name: guacamole_db
        hostname: guacamole_db
        image: mariadb:10.11
        restart: always
        volumes:
            - ./guacamole_db:/var/lib/mysql
        environment:
            - MYSQL_ROOT_PASSWORD=blablalinux
            - MYSQL_DATABASE=guacamole_db
            - MYSQL_USER=anyblabla
            - MYSQL_PASSWORD=blabla
        expose:
            - 3306

    guacd:
        container_name: guacd
        hostname: guacd
        image: guacamole/guacd:latest
        restart: always
        volumes:
            - ./guacd_drive:/drive:rw
            - ./guacd_record:/record:rw
        expose:
            - 4822

    guacamole:
        container_name: guacamole
        hostname: guacamole
        restart: always
        image: guacamole/guacamole:latest
        depends_on:
            - guacamole_db
            - guacd
        ports:
            - 8080:8080
        links:
            - guacd
        environment:
            - GUACD_HOSTNAME=guacd
            - MYSQL_HOSTNAME=guacamole_db
            - MYSQL_DATABASE=guacamole_db
            - MYSQL_USER=anyblabla
            - MYSQL_PASSWORD=blabla
            - REMOTE_IP_VALVE_ENABLED=true


In “environment” of the “guacamole_db” service…

Don't forget to customize the “root” password for MySQL…

- MYSQL_ROOT_PASSWORD=blablalinux

Don't forget to customize the username for MySQL…

- MYSQL_USER=anyblabla

Don't forget to customize the password for MySQL…

- MYSQL_PASSWORD=blabla

The “environment” information of the “guacamole_db” service must be the same as the “environment” information of the “guacamole” service!


The variable “- REMOTE_IP_VALVE_ENABLED=” must be activated if you are using a reverse proxy …

- REMOTE_IP_VALVE_ENABLED=true

To enable two-factor authentication , simply add this variable below the variable “- REMOTE_IP_VALVE_ENABLED=true”…

- TOTP_ENABLED=true


The default username and password is: guacadmin


You can start the container!

docker-compose up -d


Manual/Portainer - Common Instructions

sudo su
docker run --rm guacamole/guacamole /opt/guacamole/bin/initdb.sh --mysql > initdb.sql
docker exec -i guacamole_db mysql --user anyblabla --password=blabla guacamole_db < initdb.sql

The order must be adapted to your environment…

--user anyblabla --password=blabla