# Docker

This guide will walk you through setting up `renterd` using Docker compose. At the end of this guide, you should have the following:

* Installed Sia `renterd` software
* Created a `renterd` wallet

***

## Pre-requisites

To ensure you will not run into any issues with running `renterd` it is recommended your system meets the following requirements:

* **Hardware Requirements:** A stable setup that meets the following specifications is recommended. Not meeting these requirements may result in preventing slabs from uploading and can lead to a loss of data.
  * A quad-core CPU
  * 8GB of RAM
  * 256 GB SSD for `renterd`
* **Software Requirements:** Before installing `renterd`, you will need to install [Docker](https://www.docker.com/get-started/).
* **Network Access:** `renterd` requires a stable internet connection and open network access to store and retrieve data on the Sia network.

{% hint style="warning" %}
To ensure proper functionality, we are recommending a minimum of 8 GB RAM. This is because `renterd` will keep full slabs in memory when uploading. A full slab is 120MB, and a single upload may hold two or three slabs in memory. However, it is possible to run `renterd` with less RAM than this, and it may work fine depending on the use case.
{% endhint %}

## Create the compose file

Create a new file named `docker-compose.yml`. You can use the following as a template. The `/data` mount is where consensus data is stored and is required.

```yml
services:
  renterd:
    container_name: renterd
    image: ghcr.io/siafoundation/renterd:latest
    restart: unless-stopped
    ports:
      - 127.0.0.1:9980:9980/tcp
    volumes:
      - renterd-data:/data

volumes:
  renterd-data:
```

{% hint style="warning" %}
Be careful with port 9980 as Docker will expose it publicly by default. It is recommended to bind it to 127.0.0.1 to prevent unauthorized access. If you need to expose it to a LAN, ensure the port is not accessible publicly.
{% endhint %}

## Getting the `renterd` image

To get the latest `renterd` image run the following command:

```
docker compose pull
```

## Configuring `renterd`

Now that you have the latest `renterd` image downloaded, you will need to create a seed phrase and admin password. To launch the built-in configuration wizard, run the following:

```console
docker compose run --rm -it renterd config
```

![](https://3679771871-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6w9fYqdazlo30V4aFg36%2Fuploads%2Fgit-blob-a34026817e069ed2682b9fa389ec78be6823f356%2Frenterd-docker-config.gif?alt=media)

When the configuration wizard loads, you will be asked to verify the location of your data directory. Type `no` to keep the default.

![](https://3679771871-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6w9fYqdazlo30V4aFg36%2Fuploads%2Fgit-blob-c95d242f2c4fec978b9477b834ac0edfa6c00f61%2F01-renterd-docker-config.png?alt=media)

Next, you will be asked to enter a seed phrase. If you already have one that you would like to use, you can enter it now. Otherwise, you can type `seed` to generate a new one. For the purpose of this guide, we will generate a new seed.

![](https://3679771871-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6w9fYqdazlo30V4aFg36%2Fuploads%2Fgit-blob-b638de1e0ab4d43f02b7a42369cf935b5e300314%2F02-renterd-docker-config-seed.png?alt=media)

Next, you will be prompted to enter an admin password. This is used to unlock the `renterd` web UI.

![](https://3679771871-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6w9fYqdazlo30V4aFg36%2Fuploads%2Fgit-blob-cb85a5236c0ca52509508ea4c67cc1df374ed9fd%2F03-renterd-docker-config-password.png?alt=media)

Next, you will be prompted to configure s3 settings for `renterd`. This can be configured later on from the web UI if needed. Type `no` and hit enter.

![](https://3679771871-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6w9fYqdazlo30V4aFg36%2Fuploads%2Fgit-blob-250b35840d333f608a1addc2bd88fb47296f0042%2F04-renterd-docker-config-s3-settings.png?alt=media)

Finally, you will be asked if you want to configure advanced settings for `renterd`. Type `no` and hit enter to exit the configuration wizard.

![](https://3679771871-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6w9fYqdazlo30V4aFg36%2Fuploads%2Fgit-blob-f32f6e3c40c16ee3f33a4854ee73736c775e257a%2F05-renterd-docker-config-advanced-settings.png?alt=media)

## Running `renterd`

Now that you have `renterd` successfully installed and configured, it is time to run it. Use the following command to start `renterd`:

```console
docker compose up -d
```

![](https://3679771871-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6w9fYqdazlo30V4aFg36%2Fuploads%2Fgit-blob-05a3b9a2906a758fcd70fba2781cc119baa7360f%2F06-renterd-docker-started.png?alt=media)

Once `renterd` has successfully started, you can access the web UI by opening your browser and going to [http://localhost:9980](http://localhost:9980/).

![](https://3679771871-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6w9fYqdazlo30V4aFg36%2Fuploads%2Fgit-blob-801c34bff416e999000fe6a73048a2a4a7f6a2ff%2Frenterd-success.png?alt=media)

{% hint style="success" %}
Congratulations, you have successfully set up `renterd`.
{% endhint %}

## Checking the container status

To check the status of the container run:

```
docker ps -a
```

If the container is not running, it will show as `Exited` in the `STATUS` column.

![](https://3679771871-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6w9fYqdazlo30V4aFg36%2Fuploads%2Fgit-blob-f979598e7a4cc91251602adb63842450f61e442b%2F07-renterd-docker-status.png?alt=media)

## Checking the logs

To check the container logs run:

```
docker compose logs renterd
```

![](https://3679771871-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6w9fYqdazlo30V4aFg36%2Fuploads%2Fgit-blob-acaedfcbf6d7c4c2bc3069951df566b4e62fd7c8%2F08-renterd-docker-logs.png?alt=media)

## Upgrading `renterd`

It is essential to keep your host up to date. New versions of `renterd` are released regularly and contain bug fixes and performance improvements.

To upgrade your `renterd` to the newest version, simply run the following command:

```console
docker compose pull && docker compose up -d
```

![](https://3679771871-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6w9fYqdazlo30V4aFg36%2Fuploads%2Fgit-blob-cc1c8e08b9eda81bd4e44b57818bd05de72270cf%2F09-renterd-docker-upgrade.png?alt=media)

{% hint style="success" %}
Congratulations, you have successfully updated your version of `renterd`!
{% endhint %}
