Deploy with Docker Compose
Deploy OpenPanel using Docker Compose on your own server
This guide will help you deploy OpenPanel using Docker Compose. This method gives you full control over your deployment and is perfect for self-hosting on a VPS or dedicated server.
Prerequisites
- A VPS or server (Docker and Node will be installed automatically if needed)
- At least 2GB RAM (4GB+ recommended)
- Domain name pointing to your server (optional but recommended)
- Basic knowledge of command line
🙋♂️ This should work on any system. The setup script will install Docker and Node if they're not already installed.
Quick Start
Run the Setup Script
The setup script will guide you through the configuration process. It will:
- Install Node.js (if you accept and it's not already installed)
- Install Docker (if you accept and it's not already installed)
- Run an interactive quiz/wizard that asks questions about your setup
Setup takes 30s to 2 minutes depending on your VPS
The wizard will ask you questions about:
- Your domain name
- Database configuration
- Email settings (optional)
- AI integration (optional)
- Registration settings
⚠️ If the ./setup script fails to run, you can do it manually:
- Install Docker
- Install Node.js
- Install npm
- Run
npm run quizinside the self-hosting folder
Start the Services
After the setup is complete, start all OpenPanel services:
This will start all required services:
- op-db: PostgreSQL database
- op-kv: Redis cache
- op-ch: ClickHouse analytics database
- op-api: OpenPanel API server
- op-dashboard: OpenPanel dashboard (frontend)
- op-worker: Background worker for processing events
Verify Installation
Check that all containers are running:
All services should show as "healthy" or "running". You can also check the logs:
Or use the provided logs script:
Once all services are healthy, you can access OpenPanel at your configured domain (or http://your-server-ip if you haven't configured a domain).
Configuration
Environment Variables
The setup wizard will configure most environment variables automatically. You can manually edit the .env file in the self-hosting directory if needed.
For a complete reference of all available environment variables, see the Environment Variables documentation.
If you change the .env file, you need to restart the services for the changes to take effect. Use ./stop and ./start or docker compose restart.
Using Custom Docker Images
If you want to use specific image versions, edit the docker-compose.yml file and update the image tags:
Scaling Workers
To scale the worker service, set the OP_WORKER_REPLICAS environment variable:
Or edit the docker-compose.yml file:
Managing Your Deployment
OpenPanel comes with several utility scripts to help manage your deployment. All scripts should be run from within the self-hosting directory.
Basic Operations
View Logs
View logs from all services:
Or using Docker Compose directly:
View logs from a specific service:
Stop Services
Stop all services:
Or using Docker Compose:
Stop services but keep volumes (data persists):
Restart Services
Restart all services:
Or using Docker Compose:
Restart a specific service:
Rebuild Services
Rebuild and restart a specific service:
Update OpenPanel
To update to the latest version, use the update script:
This script will:
- Pull the latest changes from the repository
- Pull the latest Docker images
- Restart all services
If you don't have the ./update script, you can manually update:
Always backup your data before updating. The database migrations will run automatically when the API container starts. Also read any changes in the changelog and apply them to your instance.
Backup and Restore
Backup
Backup your PostgreSQL database:
Backup volumes:
Restore
Restore PostgreSQL database:
Troubleshooting
Services Won't Start
-
Check Docker and Docker Compose versions:
-
Check available disk space:
-
Check logs for errors:
Database Connection Issues
If services can't connect to the database:
-
Verify the database is healthy:
-
Check database logs:
-
Verify
DATABASE_URLin your.envfile matches the service nameop-db
Port Conflicts
If ports 80 or 443 are already in use, you can:
-
Change the ports in
docker-compose.yml: -
Or stop the conflicting service
Health Check Failures
If health checks are failing:
-
Check if services are actually running:
-
Increase health check timeout in
docker-compose.yml:
Using Your Own Reverse Proxy
If you're using your own reverse proxy (like Nginx or Traefik), you can disable the included Caddy proxy by commenting it out in docker-compose.yml:
Then configure your reverse proxy to forward requests:
/api/*→op-api:3000/*→op-dashboard:3000
Next Steps
- Configure email settings for password resets and invitations
- Set up AI integration for the analytics assistant
- Configure SDK to track events from your applications