A production-ready Docker Compose configuration for osTicket with MySQL 8.0 and phpMyAdmin, designed for rapid deployment and simplified management.
- osTicket: Latest version of the open-source ticketing system
- MySQL 8.0: Reliable database backend with persistent storage
- phpMyAdmin: Optional web-based database management interface
- Volume Persistence: All data survives container restarts and updates
- Simple Configuration: Environment-based settings for easy customization
- Docker Engine 20.10+
- Docker Compose 2.0+
-
Clone the repository:
git clone https://github.com/1ndevelopment/osticket-docker.git cd osticket-docker -
Build and launch the stack:
./build-run.sh
-
Wait for initialization (2-3 minutes on first run)
-
Access the application:
- osTicket: http://localhost:8080
- phpMyAdmin: http://localhost:8081
- URL: http://localhost:8080/scp/
- Username:
admin - Password:
Admin123!
- Host:
osticket-db - Database:
osticket - User:
osticket - Password:
osticketpass123
- URL: http://localhost:8081
- Username:
root - Password:
rootpassword123
Edit docker-compose.yml to customize database parameters:
environment:
MYSQL_HOST: osticket-db
MYSQL_DATABASE: osticket
MYSQL_USER: osticket
MYSQL_PASSWORD: osticketpass123To enable SMTP email support:
-
Update the osTicket service environment in
docker-compose.yml:SMTP_HOST: smtp.gmail.com SMTP_PORT: 587 SMTP_FROM: noreply@example.com SMTP_USER: your-email@gmail.com SMTP_PASS: your-app-password
-
Restart the services:
docker-compose restart osticket
Change the installation secret in docker-compose.yml:
INSTALL_SECRET: your-unique-secret-key-change-this# Start all services
docker-compose up -d
# Stop all services
docker-compose down
# Restart services
docker-compose restart
# Restart specific service
docker-compose restart osticket# All services
docker-compose logs -f
# Specific service
docker-compose logs -f osticket
docker-compose logs -f osticket-dbdocker-compose pull
docker-compose up -dData is stored in named Docker volumes:
osticket_db_data- MySQL database filesosticket_data- osTicket application filesosticket_uploads- User file attachments
docker-compose exec osticket-db mysqldump -u root -prootpassword123 osticket > backup-$(date +%Y%m%d).sqldocker run --rm \
-v osticket_db_data:/data \
-v $(pwd):/backup \
alpine tar czf /backup/osticket_volumes_$(date +%Y%m%d).tar.gz /datadocker-compose exec -T osticket-db mysql -u root -prootpassword123 osticket < backup.sql-
Change All Default Passwords
- Database root and user passwords
- osTicket admin password
INSTALL_SECRETvalue
-
Use Environment Files
# Create .env file for sensitive data cat > .env << EOF MYSQL_ROOT_PASSWORD=your-secure-password MYSQL_PASSWORD=another-secure-password INSTALL_SECRET=random-secret-key EOF # Update docker-compose.yml to reference .env variables
-
Enable HTTPS
- Deploy behind a reverse proxy (nginx, Traefik, Caddy)
- Configure SSL/TLS certificates (Let's Encrypt recommended)
-
Production Hardening
- Remove phpMyAdmin service in production environments
- Configure firewall rules to restrict port access
- Use Docker secrets for sensitive data
- Enable Docker's user namespace remapping
-
Regular Maintenance
# Update containers regularly docker-compose pull && docker-compose up -d
Check service status:
docker-compose psVerify database is running:
docker-compose logs osticket-dbTest database connectivity:
docker-compose exec osticket-db mysql -u osticket -posticketpass123 -e "SELECT 1;"Fix ownership:
docker-compose exec osticket chown -R www-data:www-data /var/www/html-
Connect to the database:
docker-compose exec osticket-db mysql -u root -prootpassword123 osticket -
Run in MySQL prompt:
UPDATE ost_staff SET passwd = MD5('newpassword') WHERE username = 'admin';
# All logs
docker-compose logs -f
# Specific service
docker-compose logs -f osticketosticket-docker/
├── docker-compose.yml # Main configuration file
├── README.md # This file
└── mysql-init/ # Optional: Custom SQL initialization scripts
Contributions are welcome! Please feel free to submit issues and pull requests.
This Docker setup is provided as-is for educational and development purposes. osTicket itself is licensed under GPL v2.
For issues specific to this Docker setup, please open an issue on GitHub. For osTicket-specific questions, refer to the official osTicket documentation.