Updating a docker container running on QNAP using SSH
SSH enabled on your QNAP NAS
1. Identify the Container and Image Name
Option A: Using Container Station GUI
-
Open Container Station.
-
Navigate to the Containers tab.
-
Click on the target container to view details.
-
Locate the Image field — this is the image used (e.g.,
linuxserver/nextcloud:latest).
Option B: Using SSH
Copy the container name (e.g., nextcloud) and run:
This returns the image name, e.g.:
2. Back Up Container Volumes (Optional but Recommended)
Check volume mappings:
Back up the volume path if necessary. For example, if a volume is mounted to /share/Container/nextcloud/config, back that up using QNAP File Station or rsync.
3. Pull the Latest Docker Image
Example:
4. Stop and Remove the Old Container
Example:
⚠️ This does not delete the image or volume data.
5. Recreate the Container with Same Settings
Get Existing Settings (Ports, Volumes, Env Vars)
Use:
Note the following:
-
Port mappings
-
Volume mounts
-
Environment variables
Re-run the Container
Example:
Replace volume paths, ports, and environment variables based on what you had before.
6. Verify Everything Works
-
Use:
to confirm the container is running.
-
Check logs:
-
Access the app via web browser or API to confirm it’s working.
7. (Optional) Remove Old Images
List unused images:
Clean up dangling images:
Or remove a specific old image manually:
Bonus: Automatically Extract and Re-run a Container
To automatically generate a docker run command:
Then review or convert the output back into a run command.
No comments to display
No comments to display