Bind mounts vs. volumes
- Bind mounts map a host folder (for example
/opt/app/data) into the container. Handy for config files you edit by hand. - Named volumes are managed by Docker under
/var/lib/docker/volumes. They’re the usual choice for database data such as PostgreSQL or MySQL.
Step 1: Install Docker
Install Docker Engine and the Compose plugin with Docker’s official convenience script:get-docker.sh before running it. Docker also documents a manual apt repository install, which gives you more control on production servers.
Step 2: Write a Compose file with persistent storage
Thiscompose.yml runs Traefik as a reverse proxy in front of a web app whose data lives in a named volume:
sudo docker compose up -d. Add HTTPS with Traefik’s Let’s Encrypt support before going live; see the Traefik documentation.
Step 3: Back up your volumes
Volumes survive container restarts, not disk failures or an accidentaldocker volume rm. FlashRDP is an unmanaged host: we run the hardware, network and power, and target 99.9% uptime, while you manage the OS, containers and application data.
Back up a volume to a compressed archive in the current folder with a temporary container:
cron and copy the archives off the server, for example to S3-compatible storage.
For databases, back up with the database’s own tool (
pg_dump, mysqldump) or stop the container first. Copying a live database’s files can produce a backup that won’t restore.