Checklist for setting up a new Ubuntu Server VM in Proxmox to run Docker

Bit of an aide-memoire as I have done this so many times now and keep forgetting bits. There may be slight differences between Ubuntu versions.

  1. Run the installer: specify options for keyboard, user account etc; set static IP (I am using subnet 10.10.10.0/24, address 10.10.10.?, gateway 10.10.10.1, nameserver 8.8.8.8, search 1.1.1.1 in my setup); don’t install any snaps
  2. Reboot and log in
  3. Update the system
  4. Address any console font issues
  5. Install Docker, Docker Compose (not via apt) and dependencies - varies by Ubuntu version so Google latest
  6. Check Docker running: sudo systemctl status docker.service
  7. Set to start on boot: sudo systemctl enable docker.service
  8. Add user to docker group (see Docker cheatsheet); log out and back in; no need to use sudo docker any more (just docker)
  9. Limit log size of Docker containers (see Docker cheatsheet)
  10. Clone any Git repos (e.g. for Docker Compose files)
  11. Run Docker Compose file/startup script in repo folder
  12. Create subdomain/s required (I am using CloudFlare as name servers)
  13. Configure Nginx Proxy Manager to point to subdomain/s and ports (do usual other security stuff if not behind a proxy)
  14. Monitor uptime and logs: if the services keep going down it might be because because you have given the VM too little RAM etc (suggest minimum of 8Gb for Docker Compose projects, ideally 16Gb), or the Docker logs are filling up all the disk space (but you can prevent that happening). I use UptimeRobot: Free Website Monitoring Service for monitoring uptime.
  15. Play with your new Web services

Doing this manually thus far but some of it could be scripted, or could use cloud-init.

Here are a couple of examples I have used so far:

  • Ozone HIS

    I had to fork the Ozone HIS repo to change the Java config (as Java was running out of memory), to use the latest Superset image to address this issue, and to change the OpenMRS reference app to the “latest” tag to (only partly successfully so far) deal with an issue stopping me adding patients. See here for my fork. Also realised that SENAITE was filling all the disk space because the Zope database needs regular “packing” (i.e. reclaiming space from deleted objects) which you can configure when you build the app - or do it manually in the Web GUI at the base-url/@@maintenance-controlpanel URL as I have been doing it with the demo Docker container.

  • Bahmni

    If you run Bahmni behind Nginx Proxy Manager, make sure to point it to https://vm-ip-address:443 as the connection to the Bahmni proxy also uses HTTPS - I wasted a lot of time getting “too many redirects” and other browser errors.

This approach is good for demo versions of Web platforms, but can be a bit rough around the edges requiring some firefighting on your part.