A robust deployment and management script for Dokploy service using Docker and Docker Swarm.
This script automates the deployment and management of Dokploy, handling Docker container orchestration, network configuration, and service management. It provides a simple interface for common operations while ensuring proper setup and security.
- Docker Integration: Seamless integration with Docker and Docker Swarm
- Automatic Service Management: Easy installation, updates, and service control
- Secure Configuration: Built-in security checks and best practices
- Traefik Reverse Proxy: Automatic setup with configurable IP bindings
- Comprehensive Logging: Detailed operation logging with color-coded output
- Modular Codebase: Well-organized, maintainable code structure
- Built-in Security: Automatic firewall configuration and security checks
- Linux-based operating system
- Root access
- Internet connection
- Available ports (80, 443)
- Docker and Docker Swarm installed
-
Clone the repository:
git clone https://github.com/Purrquinox/Purrploy.git cd purrploy -
Set permissions for all scripts:
chmod +x deployer.sh chmod +x lib/*.sh chmod +x utils/*.sh
-
Copy the example configuration:
cp config.example.yml config.yml
-
Edit the configuration file:
nano config.yml
The config.yml file contains all configurable parameters. Key settings include:
network:
# Internal port for Dokploy service
port: 3000
# Traefik configuration
traefik:
port: 80 # HTTP port
ssl_port: 443 # HTTPS port
# IP binding for Traefik
# Options:
# - Specific IP (e.g., "192.168.1.100") - Uses host networking
# - "0.0.0.0" or empty - Uses overlay network for all interfaces
advertise_addr: "0.0.0.0"docker:
release_tag: "latest"
traefik_version: "v3.1.2"
postgres_version: "16"
redis_version: "7"database:
# External database URL (optional)
url: ""
# Internal database settings
internal:
user: "dokploy"
name: "dokploy"
password: "your_secure_password"# Install Dokploy
sudo ./deployer.sh install
# Update Dokploy
sudo ./deployer.sh update
# Stop Dokploy
sudo ./deployer.sh stop
# Start Dokploy
sudo ./deployer.sh start
# Restart Dokploy
sudo ./deployer.sh restart
# Clean up (remove all containers and volumes)
sudo ./deployer.sh cleanup
# Reinstall (cleanup + install)
sudo ./deployer.sh reinstallThe script supports flexible Traefik configuration:
-
IP Binding:
- Bind to a specific IP (e.g., "192.168.1.100"):
- Uses host networking mode
- Direct port binding to the specified IP
- Optimal for single-interface deployments
- Bind to all interfaces (set
advertise_addrto "0.0.0.0" or leave empty):- Uses the
purrploy-networkoverlay network - Allows access from any network interface
- Better for multi-interface or complex network setups
- Uses the
- Bind to a specific IP (e.g., "192.168.1.100"):
-
Port Configuration:
- HTTP: Port 80 (configurable via
network.traefik.port) - HTTPS: Port 443 (configurable via
network.traefik.ssl_port)
- HTTP: Port 80 (configurable via
-
Network Mode:
- Specific IP: Uses host networking for direct port binding
- All Interfaces: Uses
purrploy-networkoverlay network for flexible access
The script is organized into several components:
purrploy/
├── deployer.sh # Main deployment script
├── config.yml # Configuration file
├── config.example.yml # Example configuration
├── LICENSE # GNU AGPL v3.0 License
├── lib/ # Library functions
│ ├── logging.sh # Logging functions
│ ├── docker.sh # Docker operations
│ ├── network.sh # Network configuration
│ ├── database.sh # Database management
│ ├── redis.sh # Redis management
│ └── traefik.sh # Traefik configuration
└── utils/ # Utility functions
├── error.sh # Error handling
└── validation.sh # Input validation
- Root Access: The script requires root access for Docker operations
- Database Security: Change default database credentials
- Network Security: Configure firewall rules appropriately
- File Permissions: Maintain proper file permissions
- Sensitive Data: Keep configuration files secure
Common issues and solutions:
-
Permission Denied:
sudo chmod +x deployer.sh
-
Docker Command Failed:
sudo systemctl restart docker
-
Port Already in Use:
sudo lsof -i :<port> sudo kill -9 <PID>
-
Regular Updates:
sudo ./deployer.sh update
-
Backup:
# Backup configuration cp config.yml config.yml.backup # Backup volumes docker volume ls | grep dokploy
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the GNU Affero General Public License v3.0 - see the LICENSE file for details.
Copyright (C) 2025 Purrquinox Technologies
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.
For support, please open an issue in the GitHub repository or contact the maintainers.
- GitHub: @purrquinox
- Email: support@purrquinox.com