2021-05-13 23:48:51 +00:00
---
title: Linux and macOS
---
2022-05-19 06:59:10 +00:00
Deploy the ClearML Server in Linux or macOS using the pre-built Docker image.
2021-05-13 23:48:51 +00:00
2022-01-23 07:50:24 +00:00
For ClearML docker images, including previous versions, see [https://hub.docker.com/r/allegroai/clearml ](https://hub.docker.com/r/allegroai/clearml ).
2023-02-16 10:17:53 +00:00
However, pulling the ClearML Docker image directly is not required. ClearML provides a docker-compose YAML file that does this.
2021-05-13 23:48:51 +00:00
The docker-compose file is included in the instructions on this page.
2023-10-03 07:42:33 +00:00
For information about upgrading ClearML Server in Linux or macOS, see [here ](upgrade_server_linux_mac.md ).
2021-05-13 23:48:51 +00:00
:::important
2022-05-19 06:59:10 +00:00
If ClearML Server is being reinstalled, clearing browser cookies for ClearML Server is recommended. For example,
2021-05-13 23:48:51 +00:00
for Firefox, go to Developer Tools > Storage > Cookies, and for Chrome, go to Developer Tools > Application > Cookies,
2022-01-23 07:50:24 +00:00
and delete all cookies under the ClearML Server URL.
2021-05-13 23:48:51 +00:00
:::
## Prerequisites
2022-01-30 10:54:40 +00:00
2021-05-13 23:48:51 +00:00
For Linux users only:
2023-09-13 07:58:54 +00:00
* Linux distribution must support Docker. For more information, see the [Docker documentation ](https://docs.docker.com/engine/install/ ).
2021-05-13 23:48:51 +00:00
* Be logged in as a user with `sudo` privileges.
* Use `bash` for all command-line instructions in this installation.
2022-01-23 07:50:24 +00:00
* The ports `8080` , `8081` , and `8008` must be available for the ClearML Server services.
2021-05-13 23:48:51 +00:00
## Deploying
2023-02-09 13:13:17 +00:00
:::caution
2022-01-23 07:50:24 +00:00
By default, ClearML Server launches with unrestricted access. To restrict ClearML Server access, follow the
2021-05-13 23:48:51 +00:00
instructions in the [Security ](clearml_server_security.md ) page.
:::
2022-05-08 08:30:09 +00:00
:::info Memory Requirement
Deploying the server requires a minimum of 4 GB of memory, 8 GB is recommended.
:::
2022-01-23 07:50:24 +00:00
**To launch ClearML Server on Linux or macOS:**
2021-05-13 23:48:51 +00:00
1. Install Docker. The instructions depend upon the operating system:
* Linux - see [Docker for Ubuntu ](https://docs.docker.com/install/linux/docker-ce/ubuntu/ ).
* macOS - see [Docker for OS X ](https://docs.docker.com/docker-for-mac/install/ ).
1. Verify the Docker CE installation. Execute the command:
docker run hello-world
The expected is output is:
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64)
3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.
1. For macOS only, increase the memory allocation in Docker Desktop to `8GB` .
1. In the top status bar, click the Docker icon.
1. Click **Preferences** ** >** **Resources** ** >** **Advanced** , and then set the memory to at least `8192` .
1. Click **Apply** .
1. For Linux only, install `docker-compose` . Execute the following commands (for more information, see [Install Docker Compose ](https://docs.docker.com/compose/install/ ) in the Docker documentation):
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
1. Increase `vm.max_map_count` for Elasticsearch in Docker. Execute the following commands, depending upon the operating system:
* Linux:
2023-01-05 13:25:02 +00:00
echo "vm.max_map_count=262144" > /tmp/99-clearml.conf
sudo mv /tmp/99-clearml.conf /etc/sysctl.d/99-clearml.conf
sudo sysctl -w vm.max_map_count=262144
sudo service docker restart
2021-05-13 23:48:51 +00:00
* macOS:
2024-04-24 07:48:39 +00:00
docker run --net=host --ipc=host --uts=host --pid=host --privileged --security-opt=seccomp=unconfined -it --rm -v /:/host alpine chroot /host
2023-01-05 13:25:02 +00:00
sysctl -w vm.max_map_count=262144
2021-05-13 23:48:51 +00:00
2022-01-23 07:50:24 +00:00
1. Remove any previous installation of ClearML Server.
2021-05-13 23:48:51 +00:00
**This clears all existing ClearML SDK databases.**
sudo rm -R /opt/clearml/
1. Create local directories for the databases and storage.
sudo mkdir -p /opt/clearml/data/elastic_7
2022-02-20 15:48:55 +00:00
sudo mkdir -p /opt/clearml/data/mongo_4/db
sudo mkdir -p /opt/clearml/data/mongo_4/configdb
2021-05-13 23:48:51 +00:00
sudo mkdir -p /opt/clearml/data/redis
sudo mkdir -p /opt/clearml/logs
sudo mkdir -p /opt/clearml/config
sudo mkdir -p /opt/clearml/data/fileserver
1. For macOS only do the following:
1. Open the Docker app.
1. Select **Preferences** .
1. On the **File Sharing** tab, add `/opt/clearml` .
1. Grant access to the Dockers, depending upon the operating system.
* Linux:
2023-01-10 08:29:40 +00:00
sudo chown -R 1000:1000 /opt/clearml
2021-05-13 23:48:51 +00:00
* macOS:
2023-01-10 08:29:40 +00:00
sudo chown -R $(whoami):staff /opt/clearml
2021-05-13 23:48:51 +00:00
2022-01-23 07:50:24 +00:00
1. Download the ClearML Server docker-compose YAML file.
2021-05-13 23:48:51 +00:00
sudo curl https://raw.githubusercontent.com/allegroai/clearml-server/master/docker/docker-compose.yml -o /opt/clearml/docker-compose.yml
2022-01-30 10:54:40 +00:00
1. For Linux only, configure the **ClearML Agent Services** . If `CLEARML_HOST_IP` is not provided, then ClearML Agent Services uses the external public address of the ClearML Server. If `CLEARML_AGENT_GIT_USER` / `CLEARML_AGENT_GIT_PASS` are not provided, then ClearML Agent Services can't access any private repositories for running service tasks.
2021-05-13 23:48:51 +00:00
export CLEARML_HOST_IP=server_host_ip_here
export CLEARML_AGENT_GIT_USER=git_username_here
export CLEARML_AGENT_GIT_PASS=git_password_here
1. Run `docker-compose` with the downloaded configuration file.
docker-compose -f /opt/clearml/docker-compose.yml up -d
The server is now running on [http://localhost:8080 ](http://localhost:8080 ).
2021-09-09 10:17:46 +00:00
## Port Mapping
2021-05-13 23:48:51 +00:00
2022-01-23 07:50:24 +00:00
After deploying ClearML Server, the services expose the following ports:
2021-05-13 23:48:51 +00:00
* Web server on port `8080`
* API server on port `8008`
* File server on port `8081`
## Restarting
**To restart ClearML Server Docker deployment:**
* Stop and then restart the Docker containers by executing the following commands:
2023-01-05 13:25:02 +00:00
docker-compose -f /opt/clearml/docker-compose.yml down
docker-compose -f /opt/clearml/docker-compose.yml up -d
2021-05-13 23:48:51 +00:00
2021-09-09 10:17:46 +00:00
## Backing Up and Restoring Data and Configuration
2021-05-13 23:48:51 +00:00
2023-08-22 08:11:29 +00:00
:::caution
Stop your server before backing up or restoring data and configuration
:::
The commands in this section are an example of how to back up and to restore data and configuration.
2021-05-13 23:48:51 +00:00
If the data and configuration folders are in `/opt/clearml` , then archive all data into `~/clearml_backup_data.tgz` , and
configuration into `~/clearml_backup_config.tgz` :
sudo tar czvf ~/clearml_backup_data.tgz -C /opt/clearml/data .
sudo tar czvf ~/clearml_backup_config.tgz -C /opt/clearml/config .
If needed, restore data and configuration by doing the following:
1. Verify the existence of backup files.
1. Replace any existing data with the backup data:
sudo rm -fR /opt/clearml/data/* /opt/clearml/config/*
sudo tar -xzf ~/clearml_backup_data.tgz -C /opt/clearml/data
sudo tar -xzf ~/clearml_backup_config.tgz -C /opt/clearml/config
1. Grant access to the data, depending upon the operating system:
* Linux:
2023-01-05 13:25:02 +00:00
sudo chown -R 1000:1000 /opt/clearml
2021-05-13 23:48:51 +00:00
* macOS:
2023-01-05 13:25:02 +00:00
sudo chown -R $(whoami):staff /opt/clearml
2021-05-13 23:48:51 +00:00
## Next Step
2024-04-30 12:31:05 +00:00
To keep track of your experiments and/or data, the `clearml` package needs to communicate with your server.
For instruction to connect the ClearML SDK to the server, see [Getting Started: First Steps ](../getting_started/ds/ds_first_steps.md ).