Issue: Portainer HTTPS Port Change - 9442

Configuration

  • G_DIETPI_VERSION_CORE=9
    G_DIETPI_VERSION_SUB=19
    G_DIETPI_VERSION_RC=2
    G_GITBRANCH=‘master’
    G_GITOWNER=‘MichaIng’
  • bookworm
  • Linux DietPi 6.1.0-41-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.158-1 (2025-11-09) x86_64 GNU/Linux
  • Architecture | amd64
  • SBC model | Native PC (x86_64)

Release Note Recommendation

I tried to re-install Portainer per the release notes to update to the HTTPS port change:

August 2025 (version 9.16):

DietPi-Software | Portainer Fresh installs and reinstalls will now enable HTTPS access on port 9442. Plain HTTP access via port 9002 remains possible for now, but will be probably disabled in the future. Let us know if you face any issues accessing Portainer via HTTPS, aside of the fact that you need to accept the self-signed certificate in browsers once.


Results of Recommendation

I followed the release notes to do a reinstall as instructed via dietpi-software reinstall.

This is what resulted, please advise:

* Command: docker run -d -p 9002:9000 -p 9442:9443 --name=portainer
  │ --restart=always -v /run/docker.sock:/var/run/docker.sock -v
  │ /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt:ro -v
  │ portainer_data:/data portainer/portainer-ce
  │  - Exit code: 125
  │  - DietPi version: v9.19.2 (MichaIng/master) | HW_MODEL: 21 | HW_ARCH: 10 |
  │ DISTRO: 7
  │  - Error log:
  │ Unable to find image ‘portainer/portainer-ce:latest’ locally
  │ latest: Pulling from portainer/portainer-ce
  │ 22d4f45bf667: Already exists
  │ 089b96337e3d: Already exists
  │ c551c6af3241: Already exists
  │ 9f7772ceb88a: Pulling fs layer
  │ d35c85f36345: Pulling fs layer
  │ f3e139b9cd66: Pulling fs layer
  │ 2d896f38a01e: Pulling fs layer
  │ 4f4fb700ef54: Pulling fs layer
  │ 2d896f38a01e: Waiting
  │ 4f4fb700ef54: Waiting
  │ 9f7772ceb88a: Verifying Checksum

Probably the same as https://dietpi.com/forum/t/portainer-fails-to-reinstall/17215

Can you check

docker ps -a

I took a look at the thread and I’m not sure about next steps. Please advise, thanks.

You would need to share the entire log from the installation attempt. Otherwise we don’t know what happened

The container already exists. Can you show

docker container ps
42e8141deccc   portainer/portainer-ee:latest              “/portainer”             2 weeks ago     Up 2 hours             8000/tcp, 9443/tcp, 0.0.0.0:9002->9000/tcp, \[::\]:9002->9000/tcp   portainer

You are running Portainer EE (BE) while we expect CE version. Pls drop container manually and try again.

1 Like

So I need to delete the container and run a dietpi-software reinstall, right? Is there an easier way to change the port without rebuilding everything? I know this isn’t a DietPi issue after going through this with you, but any help would be appreciated. Thanks!

Welcome to Docker. This is how it is working on Docker. Dropping a Container will not result in data loss.

Ok, looks like reinstall won’t work because it needs the EE version and not the CE version.

If I run this instead, will this suffice?

docker stop portainer
docker rm portainer

docker run -d
-p 8000:8000
-p 9443:9443
–name portainer
–restart=always
-v /var/run/docker.sock:/var/run/docker.sock
-v portainer_data:/data
portainer/portainer-ee:latest

Thanks for the help.

Why does it require the EE version? On a default setup, we install CE.

A few years back I moved to the EE version because it was free for individual users. When I tried reinstalling it through DietPi, everything seemed OK. No errors came up. But I could not reach the Portainer page in my browser. After checking the logs, I found out that Portainer flagged it as the wrong version. It said I would need to downgrade to CE if I wanted to keep using that version.

Do you recall the exact error message?
Portainer has an issue with latest docker version as docker raised the min API version. This seems to impact CE but not EE. However there are workaround.

This is the issue that’s occuring, as a result it won’t let me access Portainer from the UI anymore.

There’s a specific business image version called portainer-ee and the re-install pulls portainer-ce

I suppose the ideal scenario is the reinstall script checks the version type that was installed and pull the appropriate image in.

Otherwise, I just need help getting the port changed without messing up my install.


This is what I see in the logs:

2025/11/20 08:56PM INF github.com/portainer/portainer/api/cmd/portainer/main.go:325 > encryption key file not present | filename=/run/secrets/portainer
2025/11/20 08:56PM INF github.com/portainer/portainer/api/cmd/portainer/main.go:365 > proceeding without encryption key |
2025/11/20 08:56PM INF github.com/portainer/portainer/api/database/boltdb/db.go:137 > loading PortainerDB | filename=portainer.db
2025/11/20 08:56PM FTL github.com/portainer/portainer/api/datastore/migrator/migrate_ce.go:98 > the Portainer database is set for Portainer Business Edition, please follow the instructions in our documentation to downgrade it: https://documentation.portainer.io/v2.0-be/downgrade/be-to-ce/ |


Dump from the reinstall:

DietPi-Software
─────────────────────────────────────────────────────
Step: Installing Portainer: Simplifies container management in Docker (standalone host)

WARNING: This output is designed for human readability. For machine-readable output, please use --format.
\[ INFO \] DietPi-Software | Portainer will be deployed now. This could take a while…
\[ INFO \] DietPi-Software | docker run -d -p 9002:9000 -p 9442:9443 --name=portainer --restart=always -v /run/docker.sock:/var/run/docker.sock -v /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt:ro -v portainer_data:/data portainer/portainer-ce, please wait…
Unable to find image ‘portainer/portainer-ce:latest’ locally
latest: Pulling from portainer/portainer-ce
a48e87497a08: Already exists
7e764748a0e3: Already exists
04f56cab0724: Already exists
666c509ccde9: Pulling fs layer
6109bb7d1248: Pulling fs layer
da18f9659f11: Pulling fs layer
e80185cdbc79: Pulling fs layer
4f4fb700ef54: Pulling fs layer
e80185cdbc79: Waiting
4f4fb700ef54: Waiting
666c509ccde9: Verifying Checksum
666c509ccde9: Download complete
666c509ccde9: Pull complete
e80185cdbc79: Download complete
da18f9659f11: Verifying Checksum
da18f9659f11: Download complete
4f4fb700ef54: Verifying Checksum
4f4fb700ef54: Download complete
6109bb7d1248: Verifying Checksum
6109bb7d1248: Download complete
6109bb7d1248: Pull complete
da18f9659f11: Pull complete
e80185cdbc79: Pull complete
4f4fb700ef54: Pull complete
Digest: sha256:83fab9ec8e05a9ca17c64d2288fef25f498124eccdbcd12eaff9238870884630
Status: Downloaded newer image for portainer/portainer-ce:latest
dab22e7090bd419d2977aa7125e58944ba79f7a66a0bdcfb6af484fd46ef6159
\[  OK  \] DietPi-Software | docker run -d -p 9002:9000 -p 9442:9443 --name=portainer --restart=always -v /run/docker.sock:/var/run/docker.sock -v /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt:ro -v portainer_data:/data portainer/portainer-ce

Ok any logs from the docker engine once Portainer has been installed?

Here you go:

Nov 20 15:42:59 DietPi b1b50b669819\[53368\]: 2025/11/20 11:42PM INF github.com/portainer/portainer/api/cmd/portainer/main.go:325 > encryption key file not present | filename=/run/secrets/portainer
Nov 20 15:42:59 DietPi b1b50b669819\[53368\]: 2025/11/20 11:42PM INF github.com/portainer/portainer/api/cmd/portainer/main.go:365 > proceeding without encryption key |
Nov 20 15:42:59 DietPi b1b50b669819\[53368\]: 2025/11/20 11:42PM INF github.com/portainer/portainer/api/database/boltdb/db.go:137 > loading PortainerDB | filename=portainer.db
Nov 20 15:42:59 DietPi b1b50b669819\[53368\]: 2025/11/20 11:42PM FTL github.com/portainer/portainer/api/datastore/migrator/migrate_ce.go:98 > the Portainer database is set for Portainer Business Edition, please follow the instructions in our documentation to downgrade it: https://documentation.portainer.io/v2.0-be/downgrade/be-to-ce/ |

I would expect, if you manually install Portainer EE, that you also know how to update it and expose another port on the host? I mean you did not install Portainer via dietpi-software in the first place then, or did you do that, and then manually replaced the portainer-ce container + image with the portainer-ee one?

Probably we should rename our software option to Portainer CE, to make clear what it is, and what it is not. So when installing Portainer EE (manually), you are on your own to maintain it. I do not know Portainer EE, cannot test it without paying money, hence cannot guarantee it works as expected our end.

To allow installing both concurrently, we could rename our container to --name='portainer-ce' as well.

Not sure whether you can use the Portainer EE volumes (data/config) on Portainer CE without issues.

Ah, the logs even state that it needs to be migrated, following this link: Can I downgrade from Portainer Business to Portainer CE?

EDIT: So it is “BE” not “EE”. Was it renamed from “Enterprise Edition” to “Business Edition” or so? The container image is still called portainer-ee but named “Portainer BE”, weird.

I first installed Portainer through the DietPi installer, long before I knew the Business edition did more than unlock extra features. When I heard you could get the Business version for free, I grabbed a license key, assuming it would simply enable the extra features. Instead, it swapped to its own image and changed the database behind the scenes. Had no idea it did any of this until I created this forum post. If I’d known it would turn into this much trouble, I wouldn’t have bothered. Since my whole setup came from the DietPi installer, that’s why I reached out for help.

I know this isn’t on you. It’s just frustrating that changing this port ended up being far more complicated than it should be.

License Key Upgrade Steps within CE to EE: https://docs.portainer.io/start/upgrade/tobe/inapp

Ah so, when adding a BE license key, Portainer upgrades itself? Then a dedicated container name wouldn’t prevent such, and caused even more confusion :smile:.

Hmm, then looks like, to be failsafe we would really need to detect BE vs CE and and install the variant previously used :thinking:.

@salieri if there is no other reason to switch to CE, you can update the BE version with HTTPS port exposed like this:

# Check for existing Portainer container
local container=$(docker container ls -a | mawk '/portainer\/portainer(-ce|-ee)?( |$)/{print $1;exit}')
[[ $container ]] && G_EXEC docker container rm -f "$container"
local image=$(docker image ls -a | mawk '/portainer\/portainer(-ce|-ee)?( |$)/{print $3;exit}')
[[ $image ]] && G_EXEC docker image rm "$image"
docker volume ls -q | grep -xq 'portainer_data' || G_EXEC docker volume create portainer_data

# Deploy the Portainer container
G_DIETPI-NOTIFY 2 'Portainer will be deployed now. This could take a while...'
G_EXEC_OUTPUT=1 G_EXEC docker run -d -p '9002:9000' -p '9442:9443' --name=portainer --restart=always -v '/run/docker.sock:/var/run/docker.sock' -v '/etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt:ro' -v 'portainer_data:/data' 'portainer/portainer-ee'

@Joulinar do you remember why we check for /portainer/portainer as well as /portainer/portainer-ce? Was this to support the combined Portainer image before they split it into CE and BE?