𝗗𝗲𝗽𝗹𝗼𝘆 𝗟𝗮𝗯𝗲𝗹 𝗦𝘁𝘂𝗱𝗶𝗼 𝗼𝗻 𝗨𝗯𝘂𝗻𝘁𝘂 𝟮𝟰.𝟬𝟰
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.
- Prepare your directory
Run these commands to create a folder for your project:
$ mkdir ~/labelstudio $ cd ~/labelstudio
- Set your environment variables
Create a .env file:
$ nano .env
Add your domain and email:
DOMAIN=labelstudio.example.com LETSENCRYPT_EMAIL=admin@example.com
- 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
- Set permissions and start
Create the data folder:
$ mkdir data $ sudo chown :0 data
Run the services:
$ docker compose up -d
- 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:
- Connect ML backends like PyTorch for active learning.
- Invite team members with specific roles.
- Export your data in formats like JSON, CSV, or YOLO.
Source: https://dev.to/vultr/deploying-label-studio-open-source-data-labeling-platform-on-ubuntu-2404-5bd0
Optional learning community: https://t.me/GyaanSetuAi