Before updating, always make sure you have a current backup. Plan for about 10-20 minutes of downtime. You can update your Hudu instance to a new version by:
sudo docker-compose downto bring the instance down.
sudo docker-compose pullto pull the latest version.
sudo docker-compose upto start the server again.
It is absolutely critical that you store multiple copies of your .env file in secure locations as they contain your encryption keys.
By default, the Hudu server will run a renewal process for your certificate. However, if for some reason this does not work, you can run (in the ~/hudu2 directory)
sudo docker-compose up -dwait for it to get up and running and then type:
docker exec -it letsencrypt /app/le-renew.sh
There are two aspects of Hudu you will need to backup. The first is your database. There are multiple ways to automatically backup Postgres databases. One simple way is to add to the end of your docker-compose.yml:
pgbackups3: image: hududocker/postgresql-backup-s3 restart: unless-stopped links: - db environment: SCHEDULE: '@every 6h' S3_PREFIX: 'backup' S3_ENDPOINT: 'https://s3.us-west-1.wasabisys.com' S3_REGION: 'us-west-1' S3_ACCESS_KEY_ID: 'XXXX' S3_SECRET_ACCESS_KEY: 'XXXXXXXX' S3_BUCKET: 'bucketname' POSTGRES_DATABASE: 'hudu_production' POSTGRES_USER: 'postgres' POSTGRES_PASSWORD: POSTGRES_HOST: 'db' POSTGRES_EXTRA_OPTS: '--schema=public --blobs'
You will need to manually verify the integrity of these backups.
The other aspect you need to backup is object storage for your uploaded files. You can use s3cmd, awscli, and more to do this. Here is an example that will backup your files to your local system, using awscli:
aws s3 sync s3://your-bucket-name /home/ubuntu/s3/your-bucket-name/
Once you have a database backup, you can restore your Hudu instance to the old backup by following these steps:
~/hudu2directory. Typically, the easiest way to move files is via SCP or SFTP.
sudo docker-compose downto bring your instance down.
sudo docker-compose up -d db
sudo docker-compose exec db dropdb hudu_production -U postgres
sudo docker-compose exec db createdb hudu_production -U postgres
cat NAME-OF-DUMP.sql | sudo docker-compose exec -T db psql -d hudu_production -U postgres
sudo docker-compose down
sudo docker-compose up -dto get your instance back up and running!
Create firewall rules to only allow ports 80 and 443. You can also use a service like Cloudflare to further lock down your instance and protect from outside threats.
As the number of documentation and integrations utilized grows, the #1 cause of slowness in your Hudu instance on your instance is memory. If you want to speed up your instance, increase the memory.