Prerequisites
- Fresh Ubuntu or Debian server
- Root or sudo access
- Domain(s) pointed to your server’s IP address (DNS A records)
- Port 22 (SSH), 80 (HTTP), and 443 (HTTPS) accessible
Quick Install
Run the install script directly from GitHub:Installation Process
The script will guide you through configuration prompts:Domain Configuration
Enter your admin domain (e.g.,
dubly.example.com) and any additional redirect domains.All domains must have DNS A records pointing to your server’s IP address before installation.S3 Backups (Recommended)
Configure S3-compatible storage for automatic database backups via Litestream.You’ll need:
- S3 bucket name
- S3 endpoint URL (e.g.,
https://s3.amazonaws.com) - S3 region (e.g.,
us-east-1) - Access key ID
- Secret access key
GeoIP (Optional)
Provide a MaxMind license key for geolocation data in analytics.Get a free key at maxmind.com/en/geolite2/signup
What the Script Installs
The install script automatically sets up:- Go (v1.24.0) to
/usr/local/go - Litestream (v0.3.13) for SQLite replication
- Caddy web server for automatic HTTPS
- Dubly cloned to
/opt/dubly - Systemd service for automatic startup
- UFW firewall rules
Service management
Check service status
View Logs
Restart Services
Systemd Service Configuration
The script creates/etc/systemd/system/dubly.service:
Without S3 backups:
ExecStart line changes to:
Caddy Configuration
The script writes/etc/caddy/Caddyfile with automatic HTTPS:
Firewall Configuration
The script configures UFW with:DNS Configuration
For each domain you configured, create an A record:Verify Installation
Test the API endpoint:https://dubly.example.com
File Locations
- Installation directory:
/opt/dubly - Binary:
/opt/dubly/dubly - Environment file:
/opt/dubly/.env - Database:
/opt/dubly/dubly.db - GeoIP database:
/opt/dubly/GeoLite2-City.mmdb - Systemd service:
/etc/systemd/system/dubly.service - Caddyfile:
/etc/caddy/Caddyfile
Re-running the Install Script
The install script is idempotent and safe to re-run:- If
/opt/dubly/.envexists, you’ll be prompted to keep or overwrite configuration - Existing services will be updated, not duplicated
- Dependencies already installed will be skipped
Troubleshooting
Service won’t start
Check logs for errors:- Missing required environment variables in
/opt/dubly/.env - Database file permissions
- Port 8080 already in use
HTTPS not working
Check Caddy status:- DNS A records not pointing to server
- Firewall blocking ports 80/443
- Domain already has certificate from another service
Cannot reach admin UI
Verify:- Dubly service is running:
systemctl status dubly - Caddy is running:
systemctl status caddy - DNS is resolving:
dig yourdomain.com - Firewall allows 80/443:
sudo ufw status
Next Steps
Configure Backups
Set up automated S3 backups with Litestream
Updating Dubly
Keep your installation up to date