Updating¶
How to pull the latest version of Dreadnought without losing your data. The database and .env file are never touched during an update.
Before Updating¶
- Read the release notes on GitHub Releases to check for breaking changes
- Back up your database as a precaution:
bash cp ./data/ddns.db ./data/ddns_pre_update_$(date +%Y%m%d).db
Docker Compose¶
# Navigate to your project directory
cd /path/to/Dreadnought-DDNS
# Pull the latest code
git pull origin main
# Rebuild images and restart containers
# Your data in ./data is untouched
docker compose up -d --build
# Verify all containers are healthy
docker compose ps
# Clean up old build layers (optional — frees disk space)
docker system prune -f
What happens during docker compose up -d --build:
1. Docker rebuilds the three images from the latest source code
2. Old containers are stopped
3. New containers are started with the fresh images
4. The ./data volume is remounted as-is — no data changes
Coolify¶
- In the Coolify UI, go to your Dreadnought resource
- Click Redeploy (or enable auto-deploy from GitHub to do this automatically)
- Coolify pulls the latest code and rebuilds
Alternatively, if you've set up a GitHub webhook (see Coolify guide), pushes to main trigger automatic redeployments.
Portainer¶
- Go to Stacks → dreadnought-ddns
- If using the Git repository method: click Pull and redeploy
- Portainer pulls the latest compose file and rebuilds
Systemd (Bare Metal)¶
# 1. Stop all services
sudo systemctl stop dreadnought-api dreadnought-worker dreadnought-web
# 2. Pull latest code
cd /tmp
rm -rf dreadnought-src
git clone https://github.com/dreadnought-0/Dreadnought-DDNS.git dreadnought-src
# 3. Update backend code
sudo cp -r /tmp/dreadnought-src/backend/* /opt/dreadnought/backend/
sudo chown -R dreadnought:dreadnought /opt/dreadnought/backend
# 4. Update Python dependencies (in case new packages were added)
sudo -u dreadnought /opt/dreadnought/backend/venv/bin/pip install \
--no-cache-dir \
-r /opt/dreadnought/backend/requirements.txt
# 5. Update frontend code
sudo cp -r /tmp/dreadnought-src/frontend/* /opt/dreadnought/frontend/
sudo chown -R dreadnought:dreadnought /opt/dreadnought/frontend
# 6. Rebuild frontend
sudo -u dreadnought npm install --prefix /opt/dreadnought/frontend
sudo -u dreadnought npm run build --prefix /opt/dreadnought/frontend
# 7. Restart services
sudo systemctl start dreadnought-api dreadnought-worker dreadnought-web
# 8. Check status
sudo systemctl status dreadnought-api dreadnought-worker dreadnought-web
Checking the Current Version¶
There's no built-in version endpoint. To check which version you're running:
# Check git commit
git log --oneline -5
# Check which image tags are running
docker compose ps
docker inspect $(docker compose ps -q api) | grep -i "created\|image"
Rolling Back¶
If an update causes problems, roll back to the previous version.
Docker Compose¶
# Revert to the previous git commit
git log --oneline -5 # Find the commit hash before the update
git checkout <previous-commit-hash>
# Rebuild with the old code
docker compose up -d --build
Or restore from your database backup and start fresh:
# If the database schema changed in a bad way
cp ./data/ddns_pre_update_YYYYMMDD.db ./data/ddns.db
git checkout <previous-commit-hash>
docker compose up -d --build
Systemd¶
sudo systemctl stop dreadnought-api dreadnought-worker dreadnought-web
# Restore old code from git
cd /tmp
git clone https://github.com/dreadnought-0/Dreadnought-DDNS.git dreadnought-src
cd dreadnought-src
git checkout <previous-commit-hash>
# Re-deploy the old version (repeat Step 3-6 from the systemd update process)
Database Migrations¶
Dreadnought uses SQLAlchemy with create_all() — tables are created on startup if they don't exist, but existing tables are not modified. This means:
- Adding new features with new tables: safe, tables created automatically
- Column additions: not automatically applied to existing databases
If a specific update requires a database migration, it will be noted in the release notes with instructions.
For most updates, no migration is needed.
Keeping Base Images Updated¶
Beyond updating the application code, you should periodically pull fresh base images (Python 3.12-slim, Node 18-alpine) to get OS-level security patches:
# Force pull of latest base images and rebuild
docker compose build --pull --no-cache
docker compose up -d
# Clean up old images
docker image prune -f
Do this monthly or when a critical CVE is announced in Python or Node.js.