# Install Docker

### 0. Make sure Docker is installed

[Official installation document](https://docs.docker.com/engine/install/)

* You can install it using the convenience script provided by Docker Use it at your discretion as it is [not recommended for production environments](https://docs.docker.com/engine/install/ubuntu/#install-using-the-convenience-script).

```
curl -fsSL get.docker.com | sudo bash
```

• If you are running docker commands using a non-root user, make sure it is in the docker group. To add the current user to docker group, run the following commands:

```
# Create the `docker` group
sudo groupadd docker

# Add your current user to the docker group.
sudo usermod -aG docker $USER

# Run the following command to activate the changes to groups
newgrp docker

# Verify that you can run docker commands without sudo
docker run hello-world
```

### **1. Download the Kusama snapshot**

{% hint style="warning" %}
This step currently is not easily executable. You can also skip it and progress to step 2.
{% endhint %}

1. Install **lz4** to be able to uncompress the snapshot

```
sudo apt update
sudo apt install snapd -y
sudo snap install lz4
```

2. Create **\~/mangatax** directory and download and unpack snapshot in one step into it:

```
# Create `~/mangatax/kusama/chains/ksmcc3` directory
mkdir -p ~/mangatax/kusama/chains/ksmcc3
# Download and unpack snapshot
curl -o - -L https://ksm-rocksdb.polkashots.io/snapshot | lz4 -c -d - | tar -x -C ~/mangatax/kusama/chains/ksmcc3
```

3. The chain data should now be in **\~/mangatax/chains/ksmcc3/db**

### 2. Download chainspec

```
curl https://raw.githubusercontent.com/mangata-finance/chainspec/master/mangata-kusama-mainnet.json > ~/mangatax/mangata-kusama-mainnet.json
```

### 3. Run the Collator

1. Add `docker-compose.yml` file to your home directory with the content below:

{% hint style="info" %}
Replace \<your\_node\_name> in the following code and then execute
{% endhint %}

```
version: "3.9"
services:
  node:
    image: mangatasolutions/mangata-node:kusama-0.28.0
    restart: always
    command:
      - --name=foo
      - --collator
      - --port=30333
      - --rpc-port=9933
      - --ws-port=9944
      - --rpc-cors=all
      - --chain=/etc/storage/mangata-kusama-mainnet.json
      - --database=rocksdb
      - --base-path=/etc/storage/mangata_x
      - --unsafe-ws-external
      - --unsafe-rpc-external
      - --rpc-methods=unsafe
      - --telemetry-url=wss://telemetry.polkadot.io/submit/ 0
      - --bootnodes=/dns4/bootnode-p2p-kusama.mangata.online/tcp/30333/ws/p2p/12D3KooWQjexdWcpU9MnGcKW79aUbKDCg9iXfCYzMTJr5RNhZtow
      - --
      - --execution=wasm
      - --chain=kusama
      - --pruning=1000 
      - --database=rocksdb
      - --base-path=/etc/storage/kusama
    volumes:
      - ${HOME}/mangatax:/etc/storage
    ports:
      - 9944:9944
```

2. Run your node:

```
# To start the node run
docker compose up -d

# To check logs run, to exit logs use <Ctrl+C> keyboard combination
docker compose logs -f

# To stop the node run
docker compose down
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mangata.finance/welcome/guides/proof-of-liquidity-guides/collator-guide/install-docker.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
