Back to Article List

How to restart Portainer from the terminal

How to restart Portainer from the terminal

Updated and tested 29 October 2026

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. 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.

systemctl is-enabled docker prints enabled

Docker's own service was already enabled at boot on my Ubuntu 24.04 server after the standard install.

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.

Your idea deserves better hosting

24/7 support 30-day money-back guaranteeRefund covers the VPS plan on your first order. Cancel anytime
مدة الإشتراك

VPS.S1

€5.32 Save  17 %
€4.43 شهري
  • 2 vCPU AMD EPYC
  • 2 GB RAMذاكرة
  • 30 GB NVMeتخزين
  • نطاق ترددي غير محدود
  • IPv4 & IPv6دعم IPv6 غير متاح حاليًا في فرنسا وفنلندا أو هولندا. مشمول

VPS.S3

€13.30 Save  33 %
€8.87 شهري
  • 4 vCPU AMD EPYC
  • 6 GB RAMذاكرة
  • 70 GB NVMeتخزين
  • نطاق ترددي غير محدود
  • IPv4 & IPv6دعم IPv6 غير متاح حاليًا في فرنسا وفنلندا أو هولندا. مشمول

VPS.S4

€17.74 Save  20 %
€14.19 شهري
  • 6 vCPU AMD EPYC
  • 8 GB RAMالذاكرة
  • 80 GB NVMeالتخزين
  • نطاق ترددي غير محدود
  • IPv4 & IPv6دعم IPv6 غير متاح حاليًا في فرنسا وفنلندا أو هولندا. مشمول

EPYC VPS.P1

€7.98 Save  22 %
€6.20 شهري
  • 2 vCPU AMD EPYC
  • 4 GB RAMذاكرة
  • 40 GB NVMeتخزين
  • نطاق ترددي غير محدود
  • IPv4 & IPv6دعم IPv6 غير متاح حاليًا في فرنسا وفنلندا أو هولندا. مشمول
  • نسخ احتياطي تلقائي مجانييشمل خانة نسخ احتياطي واحدة يمكنك ضبطها للتشغيل يوميًا أو أسبوعيًا أو شهريًا.

EPYC VPS.P2

€15.08 Save  24 %
€11.53 شهري
  • 2 vCPU AMD EPYC
  • 8 GB RAMذاكرة
  • 80 GB NVMeتخزين
  • نطاق ترددي غير محدود
  • IPv4 & IPv6دعم IPv6 غير متاح حاليًا في فرنسا وفنلندا أو هولندا. مشمول
  • نسخ احتياطي تلقائي مجانييشمل خانة نسخ احتياطي واحدة يمكنك ضبطها للتشغيل يوميًا أو أسبوعيًا أو شهريًا.

EPYC VPS.P4

€26.62 Save  23 %
€20.41 شهري
  • 4 vCPU AMD EPYC
  • 16 GB RAMذاكرة
  • 160 GB NVMeتخزين
  • نطاق ترددي غير محدود
  • IPv4 & IPv6دعم IPv6 غير متاح حاليًا في فرنسا وفنلندا أو هولندا. مشمول
  • نسخ احتياطي تلقائي مجانييشمل خانة نسخ احتياطي واحدة يمكنك ضبطها للتشغيل يوميًا أو أسبوعيًا أو شهريًا.

EPYC VPS.P5

€35.49 Save  25 %
€26.62 شهري
  • 8 vCPU AMD EPYC
  • 16 GB RAMذاكرة
  • 180 GB NVMeتخزين
  • نطاق ترددي غير محدود
  • IPv4 & IPv6دعم IPv6 غير متاح حاليًا في فرنسا وفنلندا أو هولندا. مشمول
  • نسخ احتياطي تلقائي مجانييشمل خانة نسخ احتياطي واحدة يمكنك ضبطها للتشغيل يوميًا أو أسبوعيًا أو شهريًا.

EPYC VPS.P6

€53.24 Save  25 %
€39.93 شهري
  • 8 vCPU AMD EPYC
  • 32 GB RAMذاكرة
  • 200 GB NVMeتخزين
  • نطاق ترددي غير محدود
  • IPv4 & IPv6دعم IPv6 غير متاح حاليًا في فرنسا وفنلندا أو هولندا. مشمول
  • نسخ احتياطي تلقائي مجانييشمل خانة نسخ احتياطي واحدة يمكنك ضبطها للتشغيل يوميًا أو أسبوعيًا أو شهريًا.

EPYC VPS.P7

€62.12 Save  29 %
€44.37 شهري
  • 16 vCPU AMD EPYC
  • 32 GB RAMذاكرة
  • 240 GB NVMeتخزين
  • نطاق ترددي غير محدود
  • IPv4 & IPv6دعم IPv6 غير متاح حاليًا في فرنسا وفنلندا أو هولندا. مشمول
  • نسخ احتياطي تلقائي مجانييشمل خانة نسخ احتياطي واحدة يمكنك ضبطها للتشغيل يوميًا أو أسبوعيًا أو شهريًا.

Genoa VPS.G2

€22.18 Save  20 %
€17.74 شهري
  • 2 vCPUمعالج AMD EPYC Genoa من الجيل الرابع 9xx4 بسرعة 3.25 GHz أو ما يماثله، على معمارية Zen 4. AMD EPYC G4
  • 4 GB DDR5ذاكرة
  • 50 GB NVMeتخزين
  • نطاق ترددي غير محدود
  • IPv4 & IPv6دعم IPv6 غير متاح حاليًا في فرنسا وفنلندا أو هولندا. مشمول
  • نسخ احتياطي تلقائي مجانييشمل خانة نسخ احتياطي واحدة يمكنك ضبطها للتشغيل يوميًا أو أسبوعيًا أو شهريًا.

Genoa VPS.G4

€39.93 Save  22 %
€31.06 شهري
  • 4 vCPUمعالج AMD EPYC مع أنوية vCPU مخصصة، على عتاد خوادم للمؤسسات. AMD EPYC G4
  • 8 GB DDR5ذاكرة
  • 100 GB NVMeتخزين
  • نطاق ترددي غير محدود
  • IPv4 & IPv6دعم IPv6 غير متاح حاليًا في فرنسا وفنلندا أو هولندا. مشمول
  • نسخ احتياطي تلقائي مجانييشمل خانة نسخ احتياطي واحدة يمكنك ضبطها للتشغيل يوميًا أو أسبوعيًا أو شهريًا.

Genoa VPS.G6

€79.87 Save  22 %
€62.12 شهري
  • 8 vCPUمعالج AMD EPYC مع أنوية vCPU مخصصة، على عتاد خوادم للمؤسسات. AMD EPYC G4
  • 16 GB DDR5ذاكرة
  • 200 GB NVMeتخزين
  • نطاق ترددي غير محدود
  • IPv4 & IPv6دعم IPv6 غير متاح حاليًا في فرنسا وفنلندا أو هولندا. مشمول
  • نسخ احتياطي تلقائي مجانييشمل خانة نسخ احتياطي واحدة يمكنك ضبطها للتشغيل يوميًا أو أسبوعيًا أو شهريًا.

Genoa VPS.G7

€142.00 Save  22 %
€110.94 شهري
  • 8 vCPUمعالج AMD EPYC مع أنوية vCPU مخصصة، على عتاد خوادم للمؤسسات. AMD EPYC G4
  • 32 GB DDR5ذاكرة
  • 250 GB NVMeتخزين
  • نطاق ترددي غير محدود
  • IPv4 & IPv6دعم IPv6 غير متاح حاليًا في فرنسا وفنلندا أو هولندا. مشمول
  • نسخ احتياطي تلقائي مجانييشمل خانة نسخ احتياطي واحدة يمكنك ضبطها للتشغيل يوميًا أو أسبوعيًا أو شهريًا.

AMD Ryzen VPS.R1

€15.08 Save  18 %
€12.42 شهري
  • 1 CPU مخصص معالج AMD Ryzen 9 7950X بسرعة 4.5 GHz أو ما يماثله، على معمارية Zen 4. vCPU
  • 4 GB DDR5ذاكرة
  • 50 GB NVMeتخزين
  • نطاق ترددي غير محدود
  • IPv4 & IPv6 مشمول دعم IPv6 غير متاح حاليًا في فرنسا وفنلندا أو هولندا.
  • نسخ احتياطي تلقائي مشمول

AMD Ryzen VPS.R2

€26.62 Save  17 %
€22.18 شهري
  • 2 CPU مخصصان معالج AMD Ryzen 9 7950X بسرعة 4.5 GHz أو ما يماثله، على معمارية Zen 4. vCPU
  • 8 GB DDR5ذاكرة
  • 100 GB NVMeتخزين
  • نطاق ترددي غير محدود
  • IPv4 & IPv6 مشمول دعم IPv6 غير متاح حاليًا في فرنسا وفنلندا أو هولندا.
  • نسخ احتياطي تلقائي مشمول

AMD Ryzen VPS.R4

€97.62 Save  18 %
€79.87 شهري
  • 8 CPU مخصصة معالج AMD Ryzen 9 7950X بسرعة 4.5 GHz أو ما يماثله، على معمارية Zen 4. vCPU
  • 32 GB DDR5ذاكرة
  • 400 GB NVMeتخزين
  • نطاق ترددي غير محدود
  • IPv4 & IPv6 مشمول دعم IPv6 غير متاح حاليًا في فرنسا وفنلندا أو هولندا.
  • نسخ احتياطي تلقائي مشمول

*VAT excluded.

INCLUDED WITH EVERY PLAN

✓ No setup fees ✓1 Gbps network
✓ Full root access on KVM ✓ Free server monitoring ✓ Firewall management ✓24/7 support

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, and prints a fresh setup token: copy the new setup_token= value from docker logs portainer and go create the account promptly this time. When I let a test install time out, the container kept running and only the setup was blocked, so docker ps showing it Up proves nothing here. This is the number one source of first-day restarts and it's working as designed, oddly comforting once you know.

Last four log lines of an unclaimed Portainer 2.45.3 container end with: instance timed out for security purposes

A throwaway install I left alone: five minutes after start, the log says the instance timed out and needs a restart.

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, which is exactly why it makes such a good first move.

Questions?

Why does Portainer keep restarting?

A restart loop means Portainer crashes while starting and the --restart=always policy brings it straight back, so docker ps shows it as Restarting instead of Up. The cause sits in docker logs --tail 50 portainer from the last attempt: in issue #3981 it was a TLS key file Portainer couldn't load, and in #8883 a fresh CentOS 7 host where only the older 2.16.2 image would start. docker inspect -f '{{.RestartCount}}' portainer tells you how many times Docker has restarted it so far.

Deploy your next project in seconds

Bring your winning ideas online faster, with modern hardware and unmetered bandwidth. Join a European cloud trusted by thousands of developers and businesses worldwide.