Apache Guacamole 1.4 Docker: Difference between revisions
m Text replacement - "mlw-continue" to "code-continue" |
|||
(12 intermediate revisions by the same user not shown) | |||
Line 13: | Line 13: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Creating Initial <code>docker-compose.yaml</code>. | Creating Initial <code>docker-compose.yaml</code>. | ||
<syntaxhighlight lang="shell" class=" | <syntaxhighlight lang="shell" class="code-continue"> | ||
docker-compose.yaml | docker-compose.yaml | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 39: | Line 39: | ||
docker cp guac_1.4_db.sql guacdb:/guac_1.4_db.sql | docker cp guac_1.4_db.sql guacdb:/guac_1.4_db.sql | ||
</syntaxhighlight>Open a shell in the container an initialize the database. | </syntaxhighlight>Open a shell in the container an initialize the database. | ||
<syntaxhighlight lang="shell" line="1" class=" | <syntaxhighlight lang="shell" line="1" class="border-top-gray-next code-continue"> | ||
docker exec -it guacdb bash | docker exec -it guacdb bash | ||
</syntaxhighlight><syntaxhighlight lang="shell" line="1" class="root-prompt | </syntaxhighlight><syntaxhighlight lang="shell" line="1" class="root-prompt code-continue-padding-top-07em"> | ||
mysql guacamole_db < /guac_1.4_db.sql | mysql guacamole_db < /guac_1.4_db.sql | ||
exit | exit | ||
Line 48: | Line 48: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Setup Apache Guacamole == | == Setup Apache Guacamole == | ||
Here we will modify <code>docker-compose.yaml</code> in the following way. Note in my case the host's port is <code>8082</code>.<syntaxhighlight lang="shell" class=" | Here we will modify <code>docker-compose.yaml</code> in the following way. Note in my case the host's port is <code>8082</code>.<syntaxhighlight lang="shell" class="code-continue"> | ||
docker-compose.yaml | docker-compose.yaml | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 58: | Line 58: | ||
container_name: guacdb | container_name: guacdb | ||
image: mariadb/server:latest | image: mariadb/server:latest | ||
restart: | restart: always | ||
environment: | environment: | ||
MYSQL_ROOT_PASSWORD: "MariaDBRootPSW" | MYSQL_ROOT_PASSWORD: "MariaDBRootPSW" | ||
Line 70: | Line 70: | ||
container_name: guacd | container_name: guacd | ||
image: guacamole/guacd | image: guacamole/guacd | ||
restart: | restart: always | ||
volumes: | volumes: | ||
- ./guacd-data/drive:/drive:rw | - ./guacd-data/drive:/drive:rw | ||
Line 78: | Line 78: | ||
container_name: guacamole | container_name: guacamole | ||
image: "guacamole/guacamole:latest" | image: "guacamole/guacamole:latest" | ||
restart: | restart: always | ||
ports: | ports: | ||
- "8082:8080" | - "8082:8080" | ||
Line 104: | Line 104: | ||
</syntaxhighlight>The next step that should be done is to create a new Administrator user and remove the default one! Also enable TOTP: the module is already integrated in the Docker container, so we just need to enable it by the docker's configuration - see line <code>36</code> of the above listing. | </syntaxhighlight>The next step that should be done is to create a new Administrator user and remove the default one! Also enable TOTP: the module is already integrated in the Docker container, so we just need to enable it by the docker's configuration - see line <code>36</code> of the above listing. | ||
== References == | == References == | ||
* [[Apache Guacamole VNC Client and PulseAudio for Desktop Users]] | |||
* Systems.dance: [https://www.systems.dance/2021/01/apache-guacamole-and-docker-compose/ '''Apache Guacamole and docker-compose'''] | * Systems.dance: [https://www.systems.dance/2021/01/apache-guacamole-and-docker-compose/ '''Apache Guacamole and docker-compose'''] | ||
*Mauro Frigerio blog: [https://frigi.ch/en/2021/07/install-guacamole-on-docker-with-traefik-and-2fa/ '''Install Guacamole on Docker with Traefik and 2FA'''] | *Mauro Frigerio blog: [https://frigi.ch/en/2021/07/install-guacamole-on-docker-with-traefik-and-2fa/ '''Install Guacamole on Docker with Traefik and 2FA'''] | ||
Line 109: | Line 110: | ||
*Apache Guacamole 1.4 Docs: [https://guacamole.apache.org/doc/gug/guacamole-docker.html Installing Guacamole with Docker] | *Apache Guacamole 1.4 Docs: [https://guacamole.apache.org/doc/gug/guacamole-docker.html Installing Guacamole with Docker] | ||
* DockerHub: [https://hub.docker.com/u/guacamole Guacamole] | * DockerHub: [https://hub.docker.com/u/guacamole Guacamole] | ||
* Stack Overflow: [https://stackoverflow.com/a/67335047/6543935 '''Difference in docker restart policy between on-failure and unless-stopped?'''] | |||
* Dev.to: [https://dev.to/suntong/autostart-docker-container-with-systemd-5aod Autostart docker container with systemd] | |||
<noinclude> | <noinclude> | ||
<div id='devStage'> | <div id='devStage'> | ||
{{devStage | {{devStage | ||
| Прндл = Linux Server | | Прндл = Linux Server | ||
| Стадий = | | Стадий = 6 | ||
| Фаза = | | Фаза = Утвърждаване | ||
| Статус = | | Статус = Утвърден | ||
| ИдтПт = Spas | | ИдтПт = Spas | ||
| РзбПт = | | РзбПт = Spas | ||
| АвтПт = Spas | | АвтПт = Spas | ||
| УтвПт = {{REVISIONUSER}} | |||
| ИдтДт = 2.08.2022 | | ИдтДт = 2.08.2022 | ||
| РзбДт = | | РзбДт = 8.08.2022 | ||
| АвтДт = | | АвтДт = 8.08.2022 | ||
| УтвДт = {{Today}} | |||
| ИдтРв = [[Special:Permalink/29778|29778]] | | ИдтРв = [[Special:Permalink/29778|29778]] | ||
| РзбРв = | | РзбРв = [[Special:Permalink/30012|30012]] | ||
| АвтРв = | | АвтРв = [[Special:Permalink/30014|30014]] | ||
| РзАРв = [[Special:Permalink/ | | РзАРв = [[Special:Permalink/29792|29792]] | ||
| УтвРв = {{REVISIONID}} | |||
| РзУРв = [[Special:Permalink/29794|29794]] | |||
}} | }} | ||
</div> | </div> | ||
</noinclude> | </noinclude> |
Latest revision as of 07:28, 26 September 2022
Pull the Docker images
docker pull guacamole/guacamole
docker pull guacamole/guacd
docker pull mariadb/server
Setup the Database
Generate Database Initialization Script.
docker run -it guacamole/guacamole /opt/guacamole/bin/initdb.sh --mysql > guac_1.4_db.sql
Creating Initial docker-compose.yaml
.
docker-compose.yaml
version: '3'
services:
guacdb:
container_name: guacdb
image: mariadb/server:latest
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: 'MariaDBRootPSW'
MYSQL_DATABASE: 'guacamole_db'
MYSQL_USER: 'guacamole_user'
MYSQL_PASSWORD: 'MariaDBUserPSW'
volumes:
- ./guacdb-data:/var/lib/mysql
volumes:
guacdb-data:
Bring the database's container up.
docker-compose up -d
Copy the database initialization script into the container.
docker cp guac_1.4_db.sql guacdb:/guac_1.4_db.sql
Open a shell in the container an initialize the database.
docker exec -it guacdb bash
mysql guacamole_db < /guac_1.4_db.sql
exit
Bring the database's container down.
docker-compose down
Setup Apache Guacamole
Here we will modify docker-compose.yaml
in the following way. Note in my case the host's port is 8082
.
docker-compose.yaml
version: "3"
services:
guacdb:
container_name: guacdb
image: mariadb/server:latest
restart: always
environment:
MYSQL_ROOT_PASSWORD: "MariaDBRootPSW"
MYSQL_DATABASE: "guacamole_db"
MYSQL_USER: "guacamole_user"
MYSQL_PASSWORD: "MariaDBUserPSW"
volumes:
- ./guacdb-data:/var/lib/mysql
guacd:
container_name: guacd
image: guacamole/guacd
restart: always
volumes:
- ./guacd-data/drive:/drive:rw
- ./guacd-data/record:/record:rw
guacamole:
container_name: guacamole
image: "guacamole/guacamole:latest"
restart: always
ports:
- "8082:8080"
environment:
GUACD_HOSTNAME: "guacd"
MYSQL_HOSTNAME: "guacdb"
MYSQL_DATABASE: "guacamole_db"
MYSQL_USER: "guacamole_user"
MYSQL_PASSWORD: "MariaDBUserPSW"
TOTP_ENABLED: "true"
depends_on:
- "guacdb"
- "guacd"
volumes:
guacdb-data:
guacd-data:
Bring everything up.
docker-compose up -d
At this point you should be able to access http://host.ip.address:8082/guacamole
and login with guacadmin
/guacadmin
.
Apache2 Reverse Proxy
Further within my dev environment I'm using the script a2proxy
to create Apache2 Reverse Proxy yo the instance:
sudo a2proxy guac 8082
The next step that should be done is to create a new Administrator user and remove the default one! Also enable TOTP: the module is already integrated in the Docker container, so we just need to enable it by the docker's configuration – see line 36
of the above listing.
References
- Apache Guacamole VNC Client and PulseAudio for Desktop Users
- Systems.dance: Apache Guacamole and docker-compose
- Mauro Frigerio blog: Install Guacamole on Docker with Traefik and 2FA
- Kifarunix: Configure TOTP Two-Factor on Apache Guacamole Native Installation
- Apache Guacamole 1.4 Docs: Installing Guacamole with Docker
- DockerHub: Guacamole
- Stack Overflow: Difference in docker restart policy between on-failure and unless-stopped?
- Dev.to: Autostart docker container with systemd