𝗗𝗲𝗽𝗹𝗼𝘆 𝗟𝗮𝗯𝗲𝗹 𝗦𝘁𝘂𝗱𝗶𝗼 𝗼𝗻 𝗨𝗯𝘂𝗻𝘁𝘂 𝟮𝟰.𝟬𝟰

Label Studio helps you label text, images, audio, and video. You can use it for machine learning workflows and team collaboration.

This guide shows you how to deploy Label Studio using Docker Compose and Traefik. Traefik provides automatic HTTPS for your domain.

Follow these steps to set it up.

  1. Prepare your directory

Run these commands to create a folder for your project:

$ mkdir ~/labelstudio $ cd ~/labelstudio

  1. Set your environment variables

Create a .env file:

$ nano .env

Add your domain and email:

DOMAIN=labelstudio.example.com LETSENCRYPT_EMAIL=admin@example.com

  1. Create the Docker Compose file

Create a file named docker-compose.yaml:

$ nano docker-compose.yaml

Paste this configuration:

services: traefik: image: traefik:v3.6 container_name: traefik command: - "--providers.docker=true" - "--providers.docker.exposedbydefault=false" - "--entrypoints.web.address=:80" - "--entrypoints.websecure.address=:443" - "--entrypoints.web.http.redirections.entrypoint.to=websecure" - "--entrypoints.web.http.redirections.entrypoint.scheme=https" - "--certificatesresolvers.letsencrypt.acme.httpchallenge=true" - "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web" - "--certificatesresolvers.letsencrypt.acme.email=${LETSENCRYPT_EMAIL}" - "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json" ports: - "80:80" - "443:443" volumes: - "./letsencrypt:/letsencrypt" - "/var/run/docker.sock:/var/run/docker.sock:ro" restart: unless-stopped

labelstudio: image: heartexlabs/label-studio:1.23.0 container_name: labelstudio expose: - "8080" environment: - DJANGO_ALLOWED_HOSTS=${DOMAIN} - CSRF_TRUSTED_ORIGINS=https://${DOMAIN} - USE_X_FORWARDED_HOST=true - SECURE_PROXY_SSL_HEADER=HTTP_X_FORWARDED_PROTO,https volumes: - ./data:/label-studio/data labels: - "traefik.enable=true" - "traefik.http.routers.labelstudio.rule=Host(${DOMAIN})" - "traefik.http.routers.labelstudio.entrypoints=websecure" - "traefik.http.routers.labelstudio.tls.certresolver=letsencrypt" - "traefik.http.services.labelstudio.loadbalancer.server.port=8080" restart: unless-stopped

  1. Set permissions and start

Create the data folder:

$ mkdir data $ sudo chown :0 data

Run the services:

$ docker compose up -d

  1. Verify the setup

Check if your containers are running:

$ docker compose ps

Access your tool at https://labelstudio.example.com. Sign up to create your admin account.

Next steps for your project:

Source: https://dev.to/vultr/deploying-label-studio-open-source-data-labeling-platform-on-ubuntu-2404-5bd0

Optional learning community: https://t.me/GyaanSetuAi