Skip to content
Back to Blog
Docker|March 15, 2026|6 min read

Managing Docker Containers with Portainer on localhost:9000

Run Portainer CE locally to manage Docker containers, images, networks, and volumes from a web UI. Covers installation, the move from port 9000 to 9443, and the security settings worth changing first.

Marel Neill Moras

Running a cluster of Docker containers locally for development or testing is a common scenario, but managing them directly through the docker CLI can get tedious quickly. Portainer provides a fantastic web UI for managing your Docker environment, and setting it up locally is surprisingly simple. It’s significantly more efficient than constantly juggling terminal windows and remembering complex docker commands, especially when dealing with multiple containers, networks, and volumes. This post outlines how to get Portainer up and running locally over HTTPS at port 9443, and touches on a few key things to watch out for.

Why Portainer? Beyond the CLI

While the docker CLI is powerful, a graphical interface streamlines many tasks. Think about redeploying an updated application – with the CLI, you’d typically pull the new image, stop the container, remove it, and then run the new container with the updated image and its configurations. Portainer allows you to do this with a few clicks, and it offers visibility into container logs, resource usage, and network configurations that's hard to replicate with just the CLI. Beyond simple deployments, Portainer makes it much easier to visualize your entire Docker infrastructure, which is crucial for debugging and understanding inter-container dependencies. It also integrates well with Docker Swarm and Kubernetes, though we'll focus solely on single-host Docker management here. Finally, its ability to manage Docker Compose files through the UI is a massive time-saver.

Installation and Configuration

The easiest way to install Portainer is to run it as a Docker container itself. It's a bit meta, but perfectly practical.

Install with persistent storage and HTTPS

Portainer uses HTTPS on port 9443 by default; HTTP port 9000 is a legacy option. This article keeps its original URL so existing links continue to work. For a local Docker Engine using a Unix socket, run:

bash
docker volume create portainer_data
docker run -d \
  --name portainer \
  --restart=always \
  -p 127.0.0.1:9443:9443 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v portainer_data:/data \
  portainer/portainer-ce:lts

The socket mount lets Portainer manage the local Docker Engine. It grants powerful access to the host, so keep this interface restricted to trusted administrators. The loopback binding makes it accessible only from this machine. Port 8000 is unnecessary for this walkthrough because we are not using Edge Agents.

Verify and complete setup

bash
docker ps --filter name=portainer
docker logs portainer

Open https://localhost:9443. A self-signed certificate is expected for the default installation; verify that you are connecting to your own local server. Follow the first-time setup prompts, including the setup token where required by your installed version, and create an administrator password. Choose the local Docker environment to view containers.

If the UI does not load, check container status and logs first. A missing socket mount prevents local engine management even if the web interface itself loads. For remote access, use an authenticated access path with appropriate TLS and firewall rules.

Basic Usage and Common Tasks

Once you’re logged in, Portainer’s UI is fairly intuitive. Let’s walk through a few common tasks.

Deploying a Simple Container

Let's deploy a simple Nginx container. In Portainer, go to "Containers" -> "Add Container." You’ll see a form with many options. For this example, we’ll use the “Docker Image” option and search for nginx. Select the nginx:latest image and click “Deploy the container.” You can then configure ports (map port 80 inside the container to a port on your host – for example, 8080), volumes, and other settings.

Containers menu and Add Container button Containers menu and Add Container button

bash
$ docker run -d -p 8080:80 --name nginx nginx:latest
b8c7a6d5e4f32109876543210fedcba9876543210fedcba9876543210fedcba987654321
$ docker ps
CONTAINER ID   IMAGE     STATUS    PORTS                                 NAMES
b8c7a6d5e4f3   nginx     Up 2 mins   0.0.0.0:8080->80/tcp, 443/tcp     nginx
Terminal DemoOpen recording

You can now access Nginx by browsing to http://localhost:8080.

Managing Docker Compose Files

Portainer excels at managing Docker Compose applications. Go to "Stacks" -> "Add stack." You can then either upload a docker-compose.yml file or edit one directly within the UI. Let's create a simple docker-compose.yml:

yaml
services:
  web:
    image: nginx:latest
    ports:
      - "8081:80"
    volumes:
      - web_content:/usr/share/nginx/html

volumes:
  web_content:

Paste this YAML into the stack editor and choose "Deploy the stack". The named volume avoids depending on a relative directory that exists only on your workstation. Nginx initializes an empty volume with its bundled page. To try the same stack from your terminal, save it as compose.yaml:

bash
docker compose -f compose.yaml up -d
docker compose -f compose.yaml ps

Now you can access the website at http://localhost:8081.

Viewing Container Logs

Accessing container logs is a breeze. Navigate to the container you're interested in and click on the "Logs" tab. You can filter the logs by severity level (e.g., "error") and search for specific keywords. This is significantly faster than using docker logs <container_id> in the terminal.

Gotchas and Tips

  • Persistence is Key: Always mount a volume when running Portainer to ensure your configuration and data are preserved. Without a volume, any changes you make will be lost when the container is removed.
  • Security: Set a strong administrator password during setup. Consider restricting access to Portainer by configuring your firewall.
  • Resource Limits: Portainer itself consumes resources. Monitor its CPU and memory usage, especially if you're running a large number of containers.
  • Updates: Regularly update Portainer to benefit from bug fixes and new features. Back up Portainer data first, then follow the official upgrade instructions and recreate the container with the same volume and socket mount.
  • User Management: Portainer supports creating multiple users with different roles and permissions. Utilize this feature to restrict access to sensitive container configurations.

Beyond the Basics: Integration and Advanced Use

Portainer can integrate with various monitoring tools, allowing you to visualize container performance metrics. You can also use Portainer to manage and deploy applications in environments beyond your localhost, such as Docker Swarm clusters or Kubernetes. The API allows programmatic control of your docker environment, useful for automation and CI/CD pipelines.

To take your Docker management to the next level, explore integrating Portainer with Prometheus and Grafana for detailed monitoring, or automate deployments via the Portainer API using scripting languages like Python. Try experimenting with Portainer's advanced features like custom templates and resource quotas to further optimize your Docker workflow.

Portainer main dashboard overview Portainer main dashboard overview

Container deployment configuration form Container deployment configuration form

UI Navigation DemoOpen recording

Source documentation

#docker#portainer#containers
Share: