Application Development Azure

Strapi on Ubuntu 24.04 on Azure User Guide

| Product: Strapi on Ubuntu 24.04 LTS on Azure

Overview

Strapi is the leading open-source headless CMS - a flexible content platform built on Node.js that lets teams model content with a visual Content-Type Builder, manage entries in a rich admin panel, and deliver everything through an automatically generated REST and GraphQL API. The cloudimg image installs Strapi 5.48.1 on Node.js 22 LTS, builds the admin panel, runs it as a systemd service behind an nginx reverse proxy on port 80, stores the SQLite database and uploaded media on a dedicated Azure data disk, and generates all application secrets and a unique admin user on the first boot of every VM. Backed by 24/7 cloudimg support.

What is included:

  • Strapi 5.48.1 on Node.js 22 LTS with the admin panel pre-built
  • The admin panel (/admin) and REST + GraphQL content API published on port 80 via nginx
  • A dedicated Azure data disk at /var/lib/strapi for the SQLite database and uploaded media
  • Per-VM application secrets and a unique admin user generated on first boot
  • strapi.service + nginx.service as systemd units, enabled and active
  • 24/7 cloudimg support

Prerequisites

An active Azure subscription, an SSH key pair, and a VNet + subnet in the target region. Standard_B2ms (2 vCPU / 8 GiB RAM) is a good starting point. NSG inbound: allow 22/tcp from your management network and 80/tcp for the admin panel and API (front with TLS for public exposure - see Enabling HTTPS).

Step 1 - Deploy from the Azure Marketplace

Sign in to the Azure Portal, choose Create a resource, search the Marketplace for Strapi by cloudimg, 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 Review + create -> Create.

Step 2 - Deploy from the Azure CLI

az vm create \
  --resource-group <your-rg> \
  --name strapi \
  --image <marketplace-image-urn> \
  --size Standard_B2ms \
  --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 strapi --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 strapi.service nginx.service

Both report active. On first boot Strapi generates its secrets, creates the admin user and builds a clean database.

Step 5 - Retrieve your admin credentials

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

sudo cat /root/strapi-credentials.txt

This file contains strapi.admin.email (admin@cloudimg.local) and strapi.admin.pass. Store the password somewhere safe.

Step 6 - Check the health endpoint

Strapi exposes a liveness endpoint (returns 204):

curl -s -o /dev/null -w '%{http_code}\n' http://localhost/_health

Step 7 - Open the admin panel

Browse to http://<vm-public-ip>/admin and sign in with admin@cloudimg.local and the password from Step 5.

Strapi login

The admin home gives you an overview of your content and workspace:

Strapi dashboard

Use the Content-Type Builder to model collection and single types and their fields - Strapi generates a REST and GraphQL API for every type you create:

Strapi Content-Type Builder

Create and manage entries in the Content Manager, with draft/publish workflows, the media library and fine-grained roles:

Strapi Content Manager

Step 8 - Authenticate against the admin API

Strapi issues an admin JWT from /admin/login. Confirm the generated credentials work:

curl -s -H 'Content-Type: application/json' --data '{"email":"admin@cloudimg.local","password":"<STRAPI_ADMIN_PASSWORD>"}' http://localhost/admin/login | head -c 80; echo

A successful login returns a JSON object containing a "token".

Step 9 - Use the content API

Once you have modelled content and created entries, Strapi serves them over REST and GraphQL on the same port 80. For example, after creating an article collection type with some published entries:

# REST
curl http://<vm-public-ip>/api/articles

# Generate an API token under Settings -> API Tokens, then:
curl -H "Authorization: Bearer <api-token>" http://<vm-public-ip>/api/articles

GraphQL is available by installing the GraphQL plugin from the Marketplace in the admin panel.

Step 10 - Confirm content lives on the dedicated disk

The SQLite database and uploaded media are stored on the dedicated Azure data disk so they survive OS changes and can be resized independently:

findmnt /var/lib/strapi

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

Enabling HTTPS

The nginx reverse proxy terminates plain HTTP on port 80. For public exposure, put a certificate in front of it - add a DNS name for the VM and install certbot, or use the companion cloudimg nginx-ssl-certbot image as a TLS reverse proxy. Keep Strapi bound to loopback (127.0.0.1:1337) so the only public surface is the TLS-terminated proxy. Set the url in /opt/strapi/config/server.js to your HTTPS address and restart Strapi.

Maintenance

  • Backups: snapshot the /var/lib/strapi data disk to back up the database and media.
  • Database: the image uses SQLite, ideal for a single server; for production scale, configure PostgreSQL in /opt/strapi/config/database.js and .env.
  • Service: sudo systemctl restart strapi after configuration changes; logs via journalctl -u strapi.
  • Security patches: unattended-upgrades remains enabled so the OS continues to receive security updates automatically.

Support

cloudimg provides 24/7 expert support for this image. Contact support@cloudimg.co.uk.