A complete Docker Compose setup for running Apache Guacamole with MySQL database backend. This project provides a production-ready Guacamole instance with automated database initialization and user management.
- Apache Guacamole: Web-based remote desktop gateway
- MySQL Database: Persistent data storage with automated setup
- Docker Compose: Easy deployment and management
- Automated Database Setup: Custom initialization scripts
- Network Isolation: Secure container networking
- Persistent Storage: Database data persistence across restarts
- Docker Engine 20.10+
- Docker Compose 2.0+
- At least 2GB RAM available
- Port 8080 available on your host
The setup consists of four main services:
guacd: Guacamole daemon (remote desktop proxy)guacweb: Guacamole web applicationguacamole-sql: MySQL database serverdb-setup: Database initialization service
git clone <your-repository-url>
cd Guacamole# Start all services in detached mode
docker-compose up -d --build
# Or start with logs visible
docker-compose up --buildOpen your browser and navigate to:
http://localhost:8080/guacamole/
- Username:
guacadmin - Password:
guacadmin
The main configuration is handled through Docker Compose environment variables:
MYSQL_DATABASE: Database name (default:guacamole_db)MYSQL_HOSTNAME: Database host (default:guacamole-sql)MYSQL_USER: Database user (default:guacamole_user)MYSQL_PASSWORD: Database password (default:pass)GUACD_HOSTNAME: Guacamole daemon host (default:guacd)
- 8080: Guacamole web interface
- 3306: MySQL database (internal only)
./dbdata: MySQL data persistence./sql_scripts: Database initialization scripts
Guacamole/
βββ docker-compose.yml # Main Docker Compose configuration
βββ docker-compose-first-run.yml # First-time setup configuration
βββ Dockerfile # Base image for database setup
βββ create_db.sh # Database creation script
βββ sql_scripts/ # SQL scripts and database setup
β βββ Dockerfile # Database setup container
β βββ create_db.sh # Database initialization
β βββ initdb.sql # Database schema
β βββ cleandb.sql # Database cleanup script
β βββ *.sql # Additional SQL scripts
βββ dbdata/ # MySQL data directory (auto-created)
The database is automatically initialized on first run through the db-setup service, which:
- Creates the
guacamole_dbdatabase - Creates the
guacamole_userwith appropriate permissions - Imports the initial schema from
initdb.sql
If you need to run database operations manually:
# Connect to MySQL container
docker exec -it guac-sql mysql -uroot -ppass
# Or run a specific SQL script
docker exec -i guac-sql mysql -uroot -ppass guacamole_db < script.sql# All services
docker-compose logs
# Specific service
docker-compose logs guacweb
docker-compose logs guacd
docker-compose logs guacamole-sql# Stop all services
docker-compose down
# Stop and remove volumes (β οΈ WARNING: This will delete all data!)
docker-compose down -v# Pull latest images and rebuild
docker-compose pull
docker-compose up -d --build- Change default passwords immediately after first login
- Consider using environment files for sensitive data
- Database is only accessible from within the Docker network
- Use HTTPS in production environments
-
Port 8080 already in use
# Check what's using the port sudo netstat -tulpn | grep :8080 # Change port in docker-compose.yml if needed
-
Database connection errors
# Check if database is running docker-compose ps guacamole-sql # Check database logs docker-compose logs guacamole-sql
-
Permission denied errors
# Ensure proper file permissions chmod +x sql_scripts/*.sh
# Complete reset (β οΈ WARNING: All data will be lost!)
docker-compose down -v
rm -rf dbdata/
docker-compose up -d --build- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the same license as Apache Guacamole.
This setup is provided as-is for educational and development purposes. For production use, ensure proper security hardening, backup strategies, and monitoring are in place.