Install Label Studio Inside Docker Container in Linux

Install Label Studio Inside Docker Container in Linux

Label Studio is a data labeling tool. It can be used to label data types such as images, text, audio, videos, and time series and export to various formats.

This tutorial explains how to install Label Studio inside a Docker container in the Linux. Commands have been tested on Ubuntu.

Prepare environment

Make sure you have installed Docker in your system. If you are using Ubuntu, installation instructions can be found in the post.

Install Label Studio

Before starting, create directory for data:

sudo mkdir -p /opt/label-studio/data

Set user, which ID is 1001 as owner for newly created directory:

sudo chown -R 1001:1001 /opt/label-studio

Note: it doesn't matter that user (ID: 1001) doesn't exist on host system. This user will be created in the container.

  • Host network

Run the following command to create a container for Label Studio that uses host network:

docker run -d --name=label-studio --restart=always --network=host \
    -v /opt/label-studio/data:/label-studio/data \
    heartexlabs/label-studio
  • User-defined bridge network

User-defined bridge network can be used for listening on different port. By default, Label Studio service is listening on port 8080. It can be changed with -p option.

docker network create app-net
docker run -d --name=label-studio --restart=always --network=app-net \
    -p 8081:8080 \
    -v /opt/label-studio/data:/label-studio/data \
    heartexlabs/label-studio

Note: it might take a while before initialization is finished and the Docker container starts to respond to requests.

Testing Label Studio

Open a web browser and go to http://<IP_ADDRESS>:8080, where <IP_ADDRESS> is the IP address of the system. Sign up a new user account and then log in to the dashboard.

Label Studio Inside Docker Container in Linux

Uninstall Label Studio

To completely remove Label Studio, remove its container:

docker rm --force label-studio

Remove Label Studio image:

docker rmi heartexlabs/label-studio

You can also remove Label Studio data:

sudo rm -rf /opt/label-studio

If a user-defined bridge network was created, you can delete it as follows:

docker network rm app-net

Leave a Comment

Cancel reply

Your email address will not be published.