docker run -d --restart unless-stopped --name web -p 8080:80 nginx
Run a detached web server that restarts automatically
Starts nginx in the background on port 8080, named web, and restarts it whenever it exits unless the operator stops it. unless-stopped is the standard policy for long-running services. Check status with docker ps.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.