Reinstall portainer on port 9000
Reinstall portainer on port 9000
Reviewed 10 sources
To reinstall Portainer on port 9000, follow these steps:
- Stop and remove the existing Portainer container:
docker stop portainer
docker rm portainer
- Optionally, remove the Portainer image if you want a clean reinstall:
docker rmi portainer/portainer-ce
- Remove the Portainer volume data if you want to reset all data (including admin credentials):
docker volume rm portainer_data
- Pull the latest Portainer image:
docker pull portainer/portainer-ce:lts
- Run a new Portainer container mapping port 9000:
docker run -d -p 9000:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:lts
This will reinstall Portainer and expose it on port 9000. Your data and settings will be retained if you don’t remove the volume in step 3. If you want a complete reset (for example, to clear admin password), remove the volume before reinstalling.docker+2
Failed loading environment
The environment named local is unreachable.
The error "Failed loading environment. The environment named local is unreachable." in Portainer typically means that Portainer cannot connect to the Docker environment on the host. Common causes and solutions are:
- Ensure the Docker daemon is running on the host. Portainer connects to Docker via the Unix socket at /var/run/docker.sock.
- When running Portainer in Docker, you must mount the Docker socket volume with
-v /var/run/docker.sock:/var/run/docker.sock. - Sometimes this error appears if the Docker API version or Docker version is incompatible with the Portainer version. Using tested Docker versions recommended by Portainer can help.
- Recent issues have been seen on newer Docker releases or Debian setups where Podman was selected by mistake or configuration is wrong.
- A full reinstall of Portainer using a stable, slightly older Portainer image version (like 2.20.2) helped some users.
- Check the Portainer container logs for errors, including lines about Podman or Docker environment mismatches.
- Restarting Portainer and Docker services, or rebooting the server can sometimes resolve transient connection issues.
- If you are using Docker Compose or custom network setups, ensure volumes and network are properly set.
A recommended command to reinstall Portainer that has resolved this problem for others is:
docker stop portainer
docker rm portainer
docker pull portainer/portainer-ce:2.20.2
docker run -d -p 9000:9000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:2.20.2
This ensures the proper Docker socket is mounted, the right ports are exposed, and the image version is compatible. Check the logs after starting to confirm no errors about environment connectivity.
If the problem persists, verify Docker API compatibility, Docker daemon status, and environment settings in Portainer. This approach addresses the common root causes for the "local environment unreachable" error in Portainer after reinstallations or upgrades.dietpi+3
Related