Ls
Artificial Intelligence (AI) Azure

Label Studio on Ubuntu 26.04 on Azure User Guide

| Product: Label Studio 1.23 on Ubuntu 26.04 LTS on Azure

Overview

This image runs Label Studio 1.23.2 Community Edition on Ubuntu 26.04 LTS: the open source data labelling platform for building training and evaluation datasets for machine learning. You set up a project with a labelling template (classification, named entities, bounding boxes, transcription and many more), import text, images, audio, video or time series, label it in the browser with your team, and export the results as JSON, CSV, COCO, YOLO and other formats.

Label Studio runs from a Python 3.14 virtual environment at /opt/label-studio/venv, made from Ubuntu's own Python, as the unprivileged labelstudio account. It listens on the virtual machine itself only (127.0.0.1:8080), and nginx serves it on port 80. Access is Label Studio's own sign-in: the image ships one administrator, admin@cloudimg.local, and sign-up is open only through your organisation's invite link, so nobody who finds the address can make themselves an account.

Everything secret is made on your virtual machine's first boot and shared with no other one: the database, the administrator's 24 character password and Django's secret key. The password is written to a file only root can read.

The image also ships with:

  • Label Studio's data (the SQLite database, uploaded files, exports and the secret key) on its own 30 GiB Azure data disk, mounted at /var/lib/label-studio
  • label-studio-manage, which runs Label Studio's own command line tool as the service account (step 9)
  • The compiler and Python headers, so pip can build any package Label Studio needs when you update it
  • No swap file
  • Ubuntu's unattended security upgrades switched on

The default operating system user is the administrator account you choose when you create the virtual machine (azureuser in the examples below).

Prerequisites

  • A Microsoft Azure subscription in which you can create resource groups, virtual networks and virtual machines
  • An SSH key pair for the administrator account
  • A network security group that allows inbound TCP 22 from your own network and TCP 80 (and 443, once you add HTTPS in step 8) from the people who will label data
  • The Azure CLI (az) if you deploy from the command line

The recommended size is Standard_B2ms (2 vCPUs, 8 GiB memory), which suits a small team labelling text and images. For many annotators at once, large imports or audio and video projects, choose a Standard_D4s_v5 (4 vCPUs, 16 GiB) or larger.

Step 1: Deploy the Virtual Machine

Option A: the Azure Portal

  1. Sign in to the Azure Portal, open Marketplace, search for Label Studio on Ubuntu 26.04 by cloudimg and select Create.
  2. On Basics choose your subscription, a resource group, a region and a name, and pick Standard_B2ms or larger. Under Administrator account choose SSH public key and enter your user name and key.
  3. Under Inbound port rules allow SSH (22) and HTTP (80). The Disks tab shows the image's 30 GiB data disk for Label Studio's data; keep it.
  4. Select Review + create, then Create. Once the virtual machine is created, limit SSH to your own network on its Networking page.

First boot finishes about a minute after the virtual machine shows Running.

Option B: the Azure CLI

Accept the Marketplace terms once per subscription, then create the virtual machine. Replace <your-mgmt-cidr> with the network you connect from, for example 203.0.113.0/24.

az vm image terms accept --urn cloudimg1647283583153:label-studio-ubuntu-26-04:default:latest

RG=label-studio-rg
az group create --name $RG --location eastus
az vm create \
  --resource-group $RG \
  --name label-studio-01 \
  --image cloudimg1647283583153:label-studio-ubuntu-26-04:default:latest \
  --size Standard_B2ms \
  --admin-username azureuser \
  --ssh-key-values ~/.ssh/id_rsa.pub \
  --public-ip-sku Standard \
  --nsg-rule NONE
az network nsg rule create --resource-group $RG --nsg-name label-studio-01NSG \
  --name AllowSSHFromMgmt --priority 1000 --access Allow --protocol Tcp \
  --direction Inbound --source-address-prefixes <your-mgmt-cidr> --destination-port-ranges 22
az network nsg rule create --resource-group $RG --nsg-name label-studio-01NSG \
  --name AllowWeb --priority 1010 --access Allow --protocol Tcp \
  --direction Inbound --source-address-prefixes <your-mgmt-cidr> --destination-port-ranges 80 443

These rules let only your own network reach Label Studio. To let annotators elsewhere in, add their networks to --source-address-prefixes on the web rule, and add HTTPS first (step 8).

Step 2: Connect to the Virtual Machine

Find the public IP address, then connect over SSH:

az vm show --resource-group label-studio-rg --name label-studio-01 --show-details --query publicIps -o tsv
ssh azureuser@<public-ip>

Check that first boot has finished, that Label Studio and nginx run, which version you have, and that Label Studio answers through nginx:

systemctl is-active label-studio nginx label-studio-firstboot
/opt/label-studio/venv/bin/pip show label-studio | grep -E '^(Name|Version)'
/opt/label-studio/venv/bin/python --version
curl -s -w '  %{http_code}\n' http://127.0.0.1/health
active
active
active
Name: label-studio
Version: 1.23.2
Python 3.14.4
{"status": "UP"}  200

If label-studio-firstboot shows activating, first boot is still running: wait a minute and check again. Label Studio starts a few seconds after it.

Label Studio and nginx running, the version installed, and the health check answering

Step 3: Read the Admin Password

The address and the administrator's sign-in made on your virtual machine's first boot are in a file only root can read:

sudo cat /root/label-studio-credentials.txt
# Label Studio - made on this VM's first boot by label-studio-firstboot.service. Unique to this VM; keep it safe.
label_studio.url=http://203.0.113.10/
label_studio.email=admin@cloudimg.local
label_studio.password=<your-admin-password>

# 1. Browse to http://203.0.113.10/ and sign in with the e-mail and password above.
# 2. Invite your team from Organization > Add Members: sign-up is open only through that invite link.
# 3. To change this password: sudo label-studio-manage reset_password --username admin@cloudimg.local

The password is 24 characters long and unique to this virtual machine.

The per VM credentials file, readable by root only

Step 4: Sign In

Open http://<public-ip>/ in your browser. Label Studio shows its sign-in page:

Label Studio's sign-in page

Sign in with admin@cloudimg.local and the password from step 3. Label Studio opens on its Home page. To show your own name instead of the e-mail address, open the avatar at the top right, then Account & Settings.

Step 5: Set Up a Project and Import Data

On the Home page select Create Project (or Create on the Projects page) and give it a name, for example Product review sentiment. Then:

  1. On Data Import, upload a file (JSON, CSV, TSV, TXT, or images, audio and video files) or paste URLs. Each row or file becomes a task.
  2. On Labeling Setup, choose a template, for example Natural Language Processing > Text Classification, and set the labels you want, for example Positive, Neutral and Negative.
  3. Select Save.

The Projects page then shows the project with how many of its tasks are labelled:

The projects page with a sentiment project, 3 of 6 tasks labelled

Step 6: Label Your Data

Open the project and select Label All Tasks, or select one task in the list. Label Studio shows the task in its labelling editor: choose the label (or press its number key) and select Submit, and Label Studio moves to the next task.

Labelling a customer review as Positive in the editor

The project's data manager shows each task, whether it is complete, who labelled it and when:

The data manager with three of six reviews labelled

Step 7: Export the Results

In the data manager select Export, choose a format (JSON, JSON-MIN, CSV, TSV, or a format your template supports, such as COCO or YOLO for bounding boxes) and select Export. Your browser downloads the file. The same export is available from the API (step 10).

Step 8: Add HTTPS on Your Own Domain

Before people outside your own network sign in, give Label Studio a domain and a free, trusted certificate from Let's Encrypt, so passwords never cross the internet in clear text. Point an A record for your domain at the virtual machine's public IP address, and allow TCP 80 and 443 in the network security group (Let's Encrypt checks the domain over port 80). Then, replacing <your-domain> and <your-email>:

sudo apt-get install -y certbot python3-certbot-nginx
sudo sed -i 's/server_name _;/server_name <your-domain>;/' /etc/nginx/sites-available/label-studio
sudo certbot --nginx -d <your-domain> -m <your-email> --agree-tos -n --redirect
printf '%s\n' 'LABEL_STUDIO_CSRF_TRUSTED_ORIGINS=https://<your-domain>' 'LABEL_STUDIO_SESSION_COOKIE_SECURE=1' \
  | sudo tee -a /etc/label-studio/label-studio.env
sudo systemctl restart label-studio

Certbot adds the certificate to nginx's site, redirects HTTP to HTTPS, and renews the certificate on its own timer. Label Studio needs the two settings because it sees each request from nginx as plain HTTP: LABEL_STUDIO_CSRF_TRUSTED_ORIGINS lets its sign-in and every form accept requests from https://<your-domain>, and LABEL_STUDIO_SESSION_COOKIE_SECURE=1 keeps the sign-in cookie on HTTPS only. Then browse to https://<your-domain>/, and close TCP 80 to everyone but Let's Encrypt's renewals if you wish.

Step 9: Invite Your Team

Open the menu (top left), then Organization, and select Add Members. Label Studio shows an invite link: send it to the people who will label data. Each opens it, chooses their own e-mail address and password, and joins your organisation. Anyone without the link is refused at Sign up.

To change the administrator's password, or any user's, run Label Studio's own tool as the service account and type the new password at the prompt:

# At the "New password:" prompt, type <new-password> (it is not shown)
sudo label-studio-manage reset_password --username admin@cloudimg.local
=> Database and media directory: /var/lib/label-studio
=> Static URL is set to: /static/
=> Database and media directory: /var/lib/label-studio
=> Static URL is set to: /static/
Read environment variables from: /var/lib/label-studio/.env
get 'SECRET_KEY' casted as <class 'str'> with default type str
Starting new HTTPS connection (1): pypi.org:443
https://pypi.org:443 "GET /pypi/label-studio/json HTTP/1.1" 200 41138
/opt/label-studio/venv/lib/python3.14/site-packages/django/db/backends/utils.py:98: RuntimeWarning: Accessing the database during app initialization is discouraged. To fix this warning, avoid executing queries in AppConfig.ready() or when your app modules are imported.
  warnings.warn(self.APPS_NOT_READY_WARNING_MSG, category=RuntimeWarning)
New password:
Password successfully changed

The lines before the prompt are Label Studio starting its tool (it also looks up the latest release on PyPI); the warning is harmless.

The credentials file still shows the first password: edit or delete it once you have changed it.

Step 10: Use the API

Label Studio's API takes a personal access token. Create one in the browser: avatar > Account & Settings > Personal Access Token > Create New Token, and copy it. A personal access token is a long lived refresh token: exchange it for a short lived access token (it lasts five minutes), then call the API with that. From your own computer, replacing <your-token>:

LS=http://<public-ip>
ACCESS=$(curl -s -X POST -H 'Content-Type: application/json' \
  -d '{"refresh": "<your-token>"}' $LS/api/token/refresh/ | python3 -c 'import json,sys; print(json.load(sys.stdin)["access"])')
curl -s -H "Authorization: Bearer $ACCESS" $LS/api/projects/ | python3 -m json.tool | head -20
curl -s -H "Authorization: Bearer $ACCESS" "$LS/api/projects/1/export?exportType=JSON" -o export.json

The API documentation is at https://api.labelstud.io/, and the Python SDK (pip install label-studio-sdk) takes the same token. Label Studio's older, never expiring API tokens are switched off in 1.23; an administrator can turn them back on under Organization > API Tokens Settings.

Step 11: Updates

Ubuntu's unattended upgrades install the operating system's security updates every day, Python included. Label Studio itself is a Python package in its own virtual environment, which they do not touch, so update it when you choose to. To see the version you have and whether a newer release is on PyPI:

/opt/label-studio/venv/bin/pip show label-studio | grep '^Version'
/opt/label-studio/venv/bin/pip index versions label-studio 2>/dev/null | head -1
Version: 1.23.2
label-studio (1.23.2)

Label Studio's version, Ubuntu's daily upgrades on, nothing waiting to install, and the data disk

Back up the data disk first (below). Then install the new release, replacing <version>, and restart:

sudo systemctl stop label-studio
sudo /opt/label-studio/venv/bin/pip install -c /opt/label-studio/constraints.txt "label-studio==<version>"
sudo /opt/label-studio/venv/bin/pip install --no-deps "django-environ==0.14.0"
sudo systemctl start label-studio

Label Studio applies any database changes the new release needs as it starts. Label Studio 1.23 pins django-environ 0.10.0, which does not run on Python 3.14 (the pkgutil.find_loader it calls was removed), so the second command puts 0.14.0 back after any update that brings 0.10.0 again (without it Label Studio stops at start with ImportError: cannot import name 'find_loader' from 'pkgutil'); once a release pins a newer one, it is not needed. /opt/label-studio/constraints.txt holds sentry-sdk below version 3, which Label Studio 1.23 does not start with. Read the release notes (https://github.com/HumanSignal/label-studio/releases) before a major update.

All of Label Studio's data is on the data disk at /var/lib/label-studio: the database (label_studio.sqlite3), uploaded files (media/), exports (export/) and the secret key (.env). Back it up with Azure Backup, or snapshot the data disk. Keep the .env file with the database: Label Studio needs that key to read the sign-in sessions and tokens it made.

Server Components

Component Version Notes
Label Studio 1.23.2 Community Edition from PyPI, Apache 2.0 licence
Python 3.14.4 Ubuntu's own, in a virtual environment at /opt/label-studio/venv
Django 5.2.20 Label Studio's web framework
django-environ 0.14.0 In place of Label Studio's 0.10.0 pin, for Python 3.14
SQLite 3 Label Studio's database, on the data disk
nginx 1.28.3 Port 80, in front of Label Studio on 127.0.0.1:8080
Ubuntu 26.04.1 LTS Azure kernel, unattended security upgrades on

Filesystem Layout

Mount Size What is there
/ 30 GB OS disk (28 GB root partition) Ubuntu, Label Studio's virtual environment in /opt/label-studio, its settings in /etc/label-studio
/var/lib/label-studio 30 GiB Azure data disk Label Studio's data: the database, uploads, exports and the secret key. Resize the disk in Azure as your data grows
/boot 989 MB Kernels
/boot/efi 105 MB EFI system partition
/mnt Azure temporary disk (size depends on the VM size) Scratch space only: Azure may wipe it on a stop, resize or redeploy

Managing the Services

systemctl status label-studio nginx --no-pager

Restart Label Studio with sudo systemctl restart label-studio; it is back in about 5 seconds. Follow its log with sudo journalctl -u label-studio -f, and nginx's in /var/log/nginx/. Label Studio's settings are in /etc/label-studio/label-studio.env, one LABEL_STUDIO_<setting>=<value> per line (https://labelstud.io/guide/start): restart it after a change.

Scripts and Log Files

Path What it does
/usr/local/sbin/label-studio-firstboot.sh First boot: makes the database, the administrator, the organisation and the secret key, and writes the credentials file
/usr/local/sbin/label-studio-manage Runs Label Studio's command line tool as the service account, with the service's settings
/root/label-studio-credentials.txt The address and the administrator's sign-in (root only)
/etc/label-studio/label-studio.env Label Studio's settings
/etc/nginx/sites-available/label-studio nginx's site
/opt/label-studio/constraints.txt The version limits for pip updates (step 11)
/var/log/cloudimg-firstboot.log The first boot log (also journalctl -u label-studio-firstboot)

On Startup

On the first boot label-studio-firstboot.service runs once, before Label Studio and nginx start. It runs label-studio init as the labelstudio account to make the database on the data disk, the administrator admin@cloudimg.local with a new password, the organisation and Django's secret key, writes the credentials file, and records /var/lib/cloudimg/label-studio-firstboot.done so it never runs again. The password goes only to that one command and the credentials file: no settings or service file holds it. On every later boot Label Studio and nginx start as normal, and Ubuntu's unattended upgrades run on their usual timers.

Troubleshooting

The browser cannot connect. Check that the network security group allows TCP 80 from your address, and that first boot has finished: systemctl status label-studio-firstboot --no-pager and sudo cat /var/log/cloudimg-firstboot.log.

nginx answers 502 Bad Gateway. Label Studio is still starting (a few seconds after a boot or restart) or has stopped: systemctl status label-studio --no-pager and sudo journalctl -u label-studio -n 50.

The sign-in is refused. Use the e-mail address admin@cloudimg.local and the password from /root/label-studio-credentials.txt. If you changed the password, the file still shows the first one; set a new one with label-studio-manage (step 9).

Signing in over HTTPS fails with "CSRF verification failed". Label Studio does not trust the HTTPS address yet: add LABEL_STUDIO_CSRF_TRUSTED_ORIGINS=https://<your-domain> to its settings and restart it (step 8).

A colleague cannot sign up. Sign-up works only through the invite link from Organization > Add Members (step 9).

An update will not start. Read sudo journalctl -u label-studio -n 50. ImportError: cannot import name 'find_loader' from 'pkgutil' means django-environ 0.10.0 came back: run the second pip command in step 11 again.

Security Recommendations

The image answers on SSH (22) and HTTP (80). Label Studio itself listens on the virtual machine only:

Listening ports, Label Studio's settings, its secret key and database readable by its own account only, and no swap

  • Add HTTPS on your own domain (step 8) before anyone signs in from outside your own network.
  • Keep the administrator password safe, change it once you have signed in (step 9), and give each person their own account through the invite link.
  • Allow SSH only from your own network in the network security group, and TCP 80 and 443 only from the people who label data.
  • Keep personal access tokens out of code and shared files; revoke one you no longer need from Account & Settings.
  • Back up the data disk regularly, and update Label Studio when a release fixes a security issue (step 11).

Support

cloudimg's support team is on hand 24 hours a day by email at support@cloudimg.co.uk, with a guaranteed response within 24 hours. For Label Studio itself, see its documentation at https://labelstud.io/guide/ and the community at https://github.com/HumanSignal/label-studio.