Deployment guide

Portainer

Overview

Portainer CE (Community Edition) gives you a browser-based control panel for Docker. You deploy and manage containers, images, volumes, networks and stacks from a web console, with live logs, an in-browser console into any container, and a docker compose editor for multi-service stacks. The SecureAnyCloud image installs Docker CE from the official Docker repository and runs Portainer CE 2.39.4 as a container, so you can start managing Docker as soon as the VM boots.

What you get:

  • Portainer CE 2.39.4 running as a container managed by Docker with a restart policy, bound to the loopback connector 127.0.0.1:9000.
  • Docker CE preinstalled from the official Docker apt repository.
  • The Portainer web console on :80, fronted by an nginx reverse proxy that passes through the WebSocket upgrade Portainer needs for its container console and live stats.
  • The local Docker environment connected automatically, so you can deploy straight away.
  • A unique admin password generated on first boot of every VM and recorded in a root-only file (user name admin).
  • A dedicated Azure data disk at /var/lib/portainer holding Portainer's database and state.
  • docker.service and nginx.service as systemd units, enabled and active.
  • An unauthenticated /healthz endpoint for Azure Load Balancer health probes.
  • 24/7 SecureAnyCloud support.

Prerequisites

  • An active Azure subscription, an SSH key pair, and a VNet and subnet in the target region.
  • A VM size of Standard_B2s (2 vCPU / 4 GiB RAM) is a reasonable starting point. Size up for heavier container workloads.
  • NSG inbound rules that allow 22/tcp from your management network and 80/tcp.

Portainer serves plain HTTP on port 80. Because the console gives full control of the Docker host, terminate TLS in front of it with your own domain (see Maintenance).

Step 1 - Deploy from the Azure Marketplace

Sign in to the Azure Portal, choose Create a resource, search the Marketplace for Portainer by SecureAnyCloud, and select Create. On Basics, pick your subscription, resource group, region and size. Under Administrator account, choose SSH public key and paste your key. Under Inbound port rules, allow SSH (22) and HTTP (80). Review the dedicated data disk on the Disks tab, then select Review + create and Create.

Step 2 - Deploy from the Azure CLI

# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:portainer-ubuntu-24-04:default:latest
az vm create \
  --resource-group <your-rg> \
  --name portainer \
  --image sac1647283583153:portainer-ubuntu-24-04:default:latest \
  --size Standard_B2s \
  --admin-username azureuser \
  --ssh-key-values ~/.ssh/id_ed25519.pub \
  --vnet-name <your-vnet> --subnet <your-subnet> \
  --public-ip-sku Standard
az vm open-port --resource-group <your-rg> --name portainer --port 80 --priority 1010

Step 3 - Connect to your VM

ssh azureuser@<vm-public-ip>

Step 4 - Confirm the services are running

systemctl is-active docker.service nginx.service

Both services report active. Docker manages the Portainer CE container, which is bound to the loopback connector 127.0.0.1:9000. nginx fronts the container on port 80 with the WebSocket upgrade the console requires. Portainer's database and state live on the dedicated Azure data disk mounted at /var/lib/portainer.

Step 5 - Retrieve your admin password

The Portainer admin password is generated uniquely on the first boot of your VM and written to a file that only root can read:

sudo cat /root/portainer-credentials.txt

This file contains PORTAINER_USERNAME (always admin), PORTAINER_PASSWORD and the URL to open. Store the password somewhere safe.

Step 6 - Confirm the health endpoint

nginx serves an unauthenticated health endpoint for load balancers and probes:

curl -s http://localhost/healthz

It returns ok. This endpoint never requires authentication, so an Azure Load Balancer health probe can use it.

Step 7 - Verify authentication from the command line

Portainer issues a JWT for correct credentials and rejects a wrong password. Read the password from the credentials file, then post it to the auth endpoint. The command embeds your unique password, so run it interactively and not from a script. Substitute the value of PORTAINER_PASSWORD from Step 5 for <PORTAINER_PASSWORD>:

curl -s -X POST -H 'Content-Type: application/json' --data '{"Username":"admin","Password":"<PORTAINER_PASSWORD>"}' http://127.0.0.1/api/auth

A correct password returns a JSON body containing a jwt token. A wrong password returns a 4xx error with no token. The local Docker environment is already connected, so the console is ready to use.

Step 8 - Sign in to the console

Browse to http://<vm-public-ip>/. Portainer shows a sign-in page. Enter the user name admin and the password from Step 5.

After you sign in, the dashboard shows the local Docker environment, already connected, with the running containers, images, volumes and networks on the host.

Step 9 - Manage containers

Open Containers from the sidebar to see every container on the host. From here you can start, stop, restart and inspect containers, view logs, open an in-browser console, and deploy new containers with Add container.

Step 10 - Deploy a stack

Open Stacks, then Add stack, to deploy a multi-service application from a docker compose file. Paste your compose definition into the web editor (or point Portainer at a Git repository), give the stack a name and select Deploy the stack.

Step 11 - Confirm data lives on the dedicated disk

Portainer's database and state (users, environments, stacks and settings) are stored under /var/lib/portainer on the dedicated Azure data disk, which is bind-mounted into the container as /data. They survive OS changes, and you can resize the disk independently:

findmnt /var/lib/portainer

The mount is backed by a separate Azure data disk that is captured into the image and provisioned again on every VM.

Maintenance

  • Password: The admin password is set on first boot. To reset it, sign in and use My account, then Change password, in the console. You can also reset the admin from the CLI by following Portainer's documentation.
  • Upgrades: Portainer runs as the portainer container from the pinned portainer/portainer-ce:2.39.4 image. To upgrade, pull a newer tag, remove the container and run it again with the same -v /var/lib/portainer:/data mount so your data is preserved.
  • Storage: All Portainer state lives under /var/lib/portainer on the data disk. Back up that volume to protect your users, environments and stacks.
  • Docker: The host's Docker engine is managed by docker.service. Containers you deploy through Portainer run directly on this host.
  • TLS: Portainer serves plain HTTP on port 80. Put TLS in front of it (for example, certbot with your own domain), because the console gives full control of the Docker host.
  • Security patches: unattended-upgrades stays enabled, so the OS keeps receiving security updates automatically.

Support

SecureAnyCloud provides 24/7 expert support for this image. Contact sales@secureanycloud.com.

Deploy on Azure

Launch Portainer CE on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.

View this image

Need Help?

Our support team is available 24/7.

sales@secureanycloud.com

Deploy on Azure