Table of Contents

Ubuntu Server Maintenance Quick Commands

This page contains common maintenance and troubleshooting commands for the Ubuntu server.

Server Health Check

Checks the main native services and important Docker containers:

echo "=== Native Services ==="
for s in plexmediaserver transmission-daemon jdownloader; do
  printf "%-22s %s\n" "$s" "$(systemctl is-active "$s" 2>/dev/null)"
done
 
echo
echo "=== Docker Services ==="
for c in nginx-proxy-manager newsblur_web newsblur_celery newsblur_nginx newsblur_haproxy; do
printf "%-22s " "$c"
docker inspect -f '{{.State.Status}}' "$c" 2>/dev/null || echo "not found"
done 

Healthy results should normally show:

plexmediaserver        active
transmission-daemon    active
jdownloader            active

nginx-proxy-manager    running
newsblur_web           running
newsblur_celery        running
newsblur_nginx         running
newsblur_haproxy       running 

Show All Running Docker Containers

docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'

Check Individual Services

Plex:

systemctl status plexmediaserver --no-pager -l

Transmission:

systemctl status transmission-daemon --no-pager -l

JDownloader:

systemctl status jdownloader --no-pager -l

Check Listening Ports

Show all listening TCP ports:

sudo ss -ltnp

Common important ports on this server include:

80       Nginx Proxy Manager HTTP
443      Nginx Proxy Manager HTTPS
32400    Plex
9095     Transmission Web/RPC
51413    Transmission peer traffic
8084     DokuWiki
8085     WordPress
8086     NewsBlur

Check Plex Locally

curl -I http://127.0.0.1:32400/web

If Plex is healthy, it should respond instead of reporting connection refused.

Check NVIDIA Driver

nvidia-smi

If this reports:

Failed to initialize NVML: Driver/library version mismatch

the NVIDIA libraries and loaded kernel module do not match.

Reboot the server before troubleshooting Plex further:

sudo reboot

Normal Ubuntu Update Procedure

Refresh package information:

sudo apt -o Acquire::ForceIPv4=true update

Review available updates:

apt list --upgradable

Install normal eligible updates:

sudo apt -o Acquire::ForceIPv4=true upgrade

Packages held back because of “phasing” can normally be left alone.

Check Whether a Reboot Is Required

if [ -f /var/run/reboot-required ]; then
  echo "REBOOT REQUIRED"
  cat /var/run/reboot-required.pkgs 2>/dev/null
else
  echo "No reboot required"
fi

Pay special attention if updates include:

linux-image
linux-headers
nvidia-driver
nvidia-utils
libnvidia
nvidia-kernel

After kernel or NVIDIA updates, reboot when Ubuntu requests it.

Reboot

sudo reboot

After reconnecting, run:

nvidia-smi

and then the normal server health check.

Disk / Mount Checks

Show mounted filesystems:

findmnt

Show mounted media drives:

findmnt | grep /mnt

Show disk space:

df -h

Show disks and filesystem information:

lsblk -f

Test /etc/fstab

After editing /etc/fstab:

sudo systemctl daemon-reload
sudo mount -a

Then verify mounts:

findmnt

External/data drives should normally use nofail so a missing drive does not prevent Ubuntu from booting.

Docker Compose Maintenance

From the directory containing a service's compose.yml or docker-compose.yml:

Pull newer images:

docker compose pull

Recreate/update containers:

docker compose up -d

Remove unused Docker images:

docker image prune

Do not run these blindly for services where a specific application version must be preserved.

Recent Service Logs

Plex:

sudo journalctl -u plexmediaserver --since "today" --no-pager

Transmission:

sudo journalctl -u transmission-daemon --since "today" --no-pager

JDownloader:

sudo journalctl -u jdownloader --since "today" --no-pager

Docker container logs:

docker logs --tail 100 CONTAINER_NAME

Follow live Docker logs:

docker logs -f --tail 100 CONTAINER_NAME

Press Ctrl+C to stop following the log.

Useful Docker Commands

Show running containers:

docker ps

Show all containers, including stopped ones:

docker ps -a

Restart one container:

docker restart CONTAINER_NAME

Inspect container status:

docker inspect -f '{{.State.Status}}' CONTAINER_NAME

Quick Troubleshooting Order

When something appears to be down:

* Run the server health check. * Check whether the service/container is running. * Check whether its expected port is listening. * Check recent logs. * Check mounted media/data drives if the application depends on them. * Run nvidia-smi if Plex is crashing after updates. * Reboot if Ubuntu reports a reboot is required after kernel or NVIDIA updates.

Conservative Update Rule

For normal maintenance, prefer:

apt update
apt upgrade

Avoid routinely using:

apt full-upgrade
apt dist-upgrade

unless there is a specific reason to do so.

Do not force phased updates unless necessary.