Back to Article List

How to restart Portainer from the terminal

How to restart Portainer from the terminal - How to restart Portainer from the terminal

The command is:

docker restart portainer

That's it for the common case, on a Raspberry Pi, a VPS or anything else running Docker, because Portainer is just a container and containers restart like containers. You can stop reading if the UI is back at :9443. You're welcome - because I don't like to make you read an entire article for a simple answer.

The rest of this page is the variants (compose installs, unknown container names, restart-at-boot) and the three situations where people search for this command in the first place, each with its own follow-up.

Restart variants by install type

The plain command assumes the container is named portainer, which the official install does. Name unknown or nonstandard? Find it, then restart by whatever it's called:

docker ps -a --format '{{.Names}}\t{{.Image}}' | grep -i portainer
docker restart YOUR_NAME

Compose installs restart from the directory holding the compose file (or with -f pointing at it):

docker compose restart portainer

And the harder reset, for when a plain restart didn't clear whatever state you're fighting: recreate instead of restart. docker stop portainer && docker rm portainer, then re-run the original run command from the install guide; the data volume survives and you get a genuinely fresh process. On compose that's docker compose up -d --force-recreate portainer, one line doing the same surgery.

Restarting Portainer on a Raspberry Pi

Nothing about the commands changes on a Pi (the search phrase suggests otherwise, so let's be explicit: same Docker, same syntax, ARM images handle themselves). What is Pi-specific is the aftermath: SD-card storage makes Portainer's startup noticeably slower than on a VPS, so give it thirty seconds before declaring the restart failed, and docker logs -f portainer shows it working through startup if you're the impatient type. I am, it's fine.

Pi people also hit reboots more often (power blips, the SD card lottery), which makes the next section theirs especially.

Restart Portainer at boot automatically

Portainer should come back on its own after every reboot, and the restart policy in the run command is what promises that. Check yours:

docker inspect -f '{{.HostConfig.RestartPolicy.Name}}' portainer

always is the answer you want. Anything else (empty, no) means someone's install command dropped the flag, fixable in place without recreating anything:

docker update --restart=always portainer

One layer beneath that, Docker itself has to start at boot for the policy to matter: systemctl is-enabled docker should say enabled, and sudo systemctl enable docker fixes it where it doesn't. Those two settings together are the difference between a self-healing setup and a Pi in a cupboard nobody can log into after a power cut.

The three reasons people restart Portainer, and what comes after

From forum archaeology and my own history, this command gets reached for in three situations, and the restart is only step one in two of them.

The security timeout on a fresh install. New Portainer, nobody created the admin account within the five-minute window, and the UI now shows "your Portainer instance has timed out for security purposes". The restart re-arms the timer, per Portainer's own FAQ; go create the account promptly this time. This is the number one source of first-day restarts and it's working as designed, oddly comforting once you know.

The UI stopped responding. A restart usually clears it, and if it recurs, the restart is treating a symptom: check the machine's memory and disk (free -h, df -h), since a starving host strangles the panel first and your containers next. Chronic unresponsiveness on an overloaded box is a sizing conversation, the kind the Portainer VPS tiers exist to end.

Something's wrong after a change. An update, an environment edit, a migration. Restart, sure, and read docker logs --tail 50 portainer before assuming the restart fixed it; errors that survive a restart are configuration, and the message names which kind. The one that mentions environments has its own page in our local environment error fix.

Restarting Portainer is wonderfully consequence-free, by the way, and worth internalizing: your containers belong to Docker and keep running through it, sessions reconnect, nothing about your stacks changes. It's the rare admin action with no downside, wich is exactly why it makes such a good first move.

Your idea deserves better hosting

24/7 support 30-day money-back guarantee Cancel anytime
Billing Cycle

VPS.S1

€5.18 Save  17 %
€4.32 Monthly
  • 2 vCPU AMD EPYC
  • 2 GB RAMMEMORY
  • 30 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6IPv6 is currently unavailable in France, Finland or the Netherlands. included

VPS.S3

€12.97 Save  33 %
€8.65 Monthly
  • 4 vCPU AMD EPYC
  • 6 GB RAMMEMORY
  • 70 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6IPv6 is currently unavailable in France, Finland or the Netherlands. included

EPYC VPS.P1

€7.78 Save  22 %
€6.05 Monthly
  • 2 vCPU AMD EPYC
  • 4 GB RAMMEMORY
  • 40 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6IPv6 is currently unavailable in France, Finland or the Netherlands. included
  • Free auto backupsIncludes one backup slot you can set to run daily, weekly or monthly.

EPYC VPS.P2

€14.70 Save  24 %
€11.24 Monthly
  • 2 vCPU AMD EPYC
  • 8 GB RAMMEMORY
  • 80 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6IPv6 is currently unavailable in France, Finland or the Netherlands. included
  • Free auto backupsIncludes one backup slot you can set to run daily, weekly or monthly.

EPYC VPS.P4

€25.96 Save  23 %
€19.90 Monthly
  • 4 vCPU AMD EPYC
  • 16 GB RAMMEMORY
  • 160 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6IPv6 is currently unavailable in France, Finland or the Netherlands. included
  • Free auto backupsIncludes one backup slot you can set to run daily, weekly or monthly.

EPYC VPS.P5

€34.61 Save  25 %
€25.96 Monthly
  • 8 vCPU AMD EPYC
  • 16 GB RAMMEMORY
  • 180 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6IPv6 is currently unavailable in France, Finland or the Netherlands. included
  • Free auto backupsIncludes one backup slot you can set to run daily, weekly or monthly.

EPYC VPS.P6

€51.92 Save  25 %
€38.94 Monthly
  • 8 vCPU AMD EPYC
  • 32 GB RAMMEMORY
  • 200 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6IPv6 is currently unavailable in France, Finland or the Netherlands. included
  • Free auto backupsIncludes one backup slot you can set to run daily, weekly or monthly.

EPYC VPS.P7

€60.58 Save  29 %
€43.27 Monthly
  • 16 vCPU AMD EPYC
  • 32 GB RAMMEMORY
  • 240 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6IPv6 is currently unavailable in France, Finland or the Netherlands. included
  • Free auto backupsIncludes one backup slot you can set to run daily, weekly or monthly.

Genoa VPS.G2

€21.63 Save  20 %
€17.30 Monthly
  • 2 vCPUAMD EPYC Genoa 4th generation 9xx4 with 3.25 GHz or similar, on Zen 4 architecture. AMD EPYC G4
  • 4 GB DDR5MEMORY
  • 50 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6IPv6 is currently unavailable in France, Finland or the Netherlands. included
  • Free auto backupsIncludes one backup slot you can set to run daily, weekly or monthly.

Genoa VPS.G4

€38.94 Save  22 %
€30.28 Monthly
  • 4 vCPUAMD EPYC processor with dedicated vCPU cores, on enterprise server hardware. AMD EPYC G4
  • 8 GB DDR5MEMORY
  • 100 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6IPv6 is currently unavailable in France, Finland or the Netherlands. included
  • Free auto backupsIncludes one backup slot you can set to run daily, weekly or monthly.

Genoa VPS.G6

€77.89 Save  22 %
€60.58 Monthly
  • 8 vCPUAMD EPYC processor with dedicated vCPU cores, on enterprise server hardware. AMD EPYC G4
  • 16 GB DDR5MEMORY
  • 200 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6IPv6 is currently unavailable in France, Finland or the Netherlands. included
  • Free auto backupsIncludes one backup slot you can set to run daily, weekly or monthly.

Genoa VPS.G7

€138.47 Save  22 %
€108.18 Monthly
  • 8 vCPUAMD EPYC processor with dedicated vCPU cores, on enterprise server hardware. AMD EPYC G4
  • 32 GB DDR5MEMORY
  • 250 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6IPv6 is currently unavailable in France, Finland or the Netherlands. included
  • Free auto backupsIncludes one backup slot you can set to run daily, weekly or monthly.

AMD Ryzen VPS.R1

€14.70 Save  18 %
€12.11 Monthly
  • 1 dedicated CPU AMD Ryzen 9 7950X with 4.5 GHz or similar, on Zen 4 architecture. vCPU
  • 4 GB DDR5MEMORY
  • 50 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6 included IPv6 support is currently unavailable in France, Finland or the Netherlands.
  • Auto backup included

AMD Ryzen VPS.R2

€25.96 Save  17 %
€21.63 Monthly
  • 2 dedicated CPUs AMD Ryzen 9 7950X with 4.5 GHz or similar, on Zen 4 architecture. vCPU
  • 8 GB DDR5MEMORY
  • 100 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6 included IPv6 support is currently unavailable in France, Finland or the Netherlands.
  • Auto backup included

AMD Ryzen VPS.R4

€95.20 Save  18 %
€77.89 Monthly
  • 8 dedicated CPUs AMD Ryzen 9 7950X with 4.5 GHz or similar, on Zen 4 architecture. vCPU
  • 32 GB DDR5MEMORY
  • 400 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6 included IPv6 support is currently unavailable in France, Finland or the Netherlands.
  • Auto backup included

Other questions & clarifications

Does restarting Portainer restart my other containers?

No. Portainer manages containers but doesn't run them; Docker does. The panel blinking out for ten seconds changes nothing about the apps, downloads or databases running beside it.

GPU products are in high demand at the moment. Fill the form to get notified as soon as your preferred GPU server is back in stock.