Safe Production Updates

March 23, 2026 ยท View on GitHub

Step-by-step guide for updating Cยณ CELERITY on production servers with minimal downtime.


๐Ÿ“‹ Pre-Update Checklist

Before any update:

  1. Create a database backup

    # Via panel UI: Dashboard โ†’ Backup โ†’ Download
    # Or manually via mongodump:
    docker exec hysteria-mongo mongodump --archive=/data/db/backup.archive --username=hysteria --password --authenticationDatabase=admin
    docker cp hysteria-mongo:/data/db/backup.archive ./backup-$(date +%Y%m%d-%H%M%S).archive
    
  2. Check current version

    docker logs hysteria-backend --tail 50 | grep -i version
    
  3. Check available disk space

    df -h
    # Minimum 2GB free space for the new image
    
  4. Backup your .env file

    cp .env .env.backup-$(date +%Y%m%d)
    

For production deployments using docker-compose.hub.yml:

1. Navigate to project directory

cd /path/to/hysteria-panel

2. Stop current containers (short downtime)

docker compose -f docker-compose.hub.yml down

Downtime: ~10-30 seconds

3. Pull the new image

docker compose -f docker-compose.hub.yml pull

4. Start updated containers

docker compose -f docker-compose.hub.yml up -d

5. Check status

# All containers should be "running"
docker compose -f docker-compose.hub.yml ps

# Check logs for errors
docker logs hysteria-backend --tail 100 -f

6. Verify accessibility

curl -I https://your-domain/panel

๐Ÿ”ง Update (build from source)

For deployments using docker-compose.yml with local build:

1. Navigate to project directory

cd /path/to/hysteria-panel

2. Get latest changes

git fetch origin
git status  # check for uncommitted changes
git pull origin main

3. Stop current containers

docker compose down

4. Rebuild the image

docker compose build --no-cache backend

Time: 2-5 minutes depending on server

5. Start containers

docker compose up -d

6. Check status

docker compose ps
docker logs hysteria-backend --tail 100 -f

๐Ÿ”„ Rollback to Previous Version

If problems occur after update:

Option 1: Rollback to specific image version

  1. Edit docker-compose.hub.yml:

    backend:
      image: clickdevtech/hysteria-panel:v1.2.3  # specify desired version
    
  2. Apply changes:

    docker compose -f docker-compose.hub.yml down
    docker compose -f docker-compose.hub.yml pull
    docker compose -f docker-compose.hub.yml up -d
    

Option 2: Rollback to previous git commit

# Find the previous working commit
git log --oneline -10

# Checkout
git checkout <commit-hash>

# Rebuild
docker compose build --no-cache backend
docker compose up -d

Option 3: Database restoration

# Restore from backup
docker cp ./backup.archive hysteria-mongo:/data/db/backup.archive
docker exec hysteria-mongo mongorestore --archive=/data/db/backup.archive --drop --username=hysteria --password --authenticationDatabase=admin

โœ… After Update

  1. Check authentication โ€” login to the panel
  2. Check nodes โ€” all nodes should show online status
  3. Check subscriptions โ€” open subscription URL in browser
  4. Check API โ€” make a test request with API key
  5. Monitor logs for 10-15 minutes:
    docker logs hysteria-backend -f --tail 50
    

โš ๏ธ Common Issues

Container won't start

# Check logs
docker logs hysteria-backend

# Common causes:
# - Error in .env file
# - MongoDB connection issue
# - Out of memory

MongoDB connection fails

# Check MongoDB status
docker logs hysteria-mongo --tail 50

# Restart MongoDB
docker compose restart mongo

SSL certificates not working

# Check greenlock.d contents
ls -la greenlock.d/

# Restart with cache clear
docker compose down
docker compose up -d

ActionFrequency
Database backupDaily (auto) + before updates
Check for updatesWeekly
Security patchesWithin 48 hours
Major updatesAfter staging testing

๐Ÿ›ก๏ธ Best Practices

  1. Test on staging โ€” duplicate environment for update testing
  2. Update during low-traffic hours โ€” night/early morning in users' timezone
  3. Keep backups โ€” at least 3 recent database backups
  4. Document changes โ€” save records of versions and update dates
  5. Don't update everything at once โ€” panel first, then nodes if needed

๐Ÿ“ž If Something Goes Wrong

  1. Don't panic โ€” data is safe in MongoDB
  2. Check logs: docker logs hysteria-backend --tail 200
  3. Rollback to previous version
  4. Restore database from backup if needed
  5. Create a GitHub issue with problem description and logs