> For the complete documentation index, see [llms.txt](https://sogni.gitbook.io/sogni-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sogni.gitbook.io/sogni-docs/sogni-fast-worker/running-sogni-fast-worker-locally.md).

# Running Sogni Fast Worker Locally

Installing Sogni Fast Worker is as simple as downloading and running the interactive installer after confirming the destination machine [meets all the requirements](https://docs.sogni.ai/sogni-fast-worker/about-sogni-fast-worker#prerequisites-to-run-a-fast-worker).

The interactive installer automatically downloads and run the latest Docker Hub hosted Sogni Fast Worker client Docker Image and any necessary models (based on your configuration choices). It then connect to the Sogni Supernet network and wait for image generation job requests. The Sogni Supernet then credits your Sogni Base wallet for work completed.&#x20;

{% hint style="warning" %}
Sogni Fast Worker currently requires a Windows or Linux machine with a supported Nvidia GPU, 40gb of ram (48+ for video), \~50gb of free disk space (100gb - 200gb for video or lots of models), and a decent internet connection (5-10 Mbps).
{% endhint %}

\
Local Installation for Windows
------------------------------

1. **Install Docker Desktop**: Available to [dowload](https://docs.docker.com/desktop/install/windows-install/) for free from docker.com
2. **Create Your App Folder**: Download the [Sogni Fast Worker Windows installer](https://api.sogni.ai/v1/download/worker/windows) zip file and extract the "Sogni Fast Worker" folder to where you want to run the worker. If you don't have another place in mind your Desktop is a fine place.
3. Note that on Windows by default WSL2 allocates 50% of system memory to Docker containers. This means if you have less than 64gb of ram, you will need to tell Docker Desktop to allocate more ram to Docker manually before running the next step. You should realistically have at least 48gb of ram to run the Fast Worker while leaving 16gb of ram for Windows. Even if you have more than 64gb of ram you can choose to allocate even more ram to the Fast Worker which can only improve long term reliability.\
   \
   If you have at least 48gb of ram you can create a new text file named `.wslconfig` in your `~\` root Windows folder (the folder above your Documents and Downloads folders). Inside that file you can paste the text below. Replace `memory=80gb` with the amount of ram you want to allocate, at least 31gb. You can also specify the number of `processors` you want to allocate. Once you do this, you can restart your computer before continuing to the next step.

```
[wsl2]
# Leave ~16 GB for Windows/drivers; In this example we have 96 GB total
memory=80GB
processors=28

# Keep a small safety net to avoid OOM kills (fast NVMe recommended)
swap=8GB
swapFile=C:\\wsl-swap.vhdx

# Keep the VM hot (undocumented but supported value works in practice)
vmIdleTimeout=-1
```

4. **Run Installer**: Double-click the `worker-install.bat` to start the interactive install process.&#x20;

{% hint style="info" %}
The installer .bat scripts for Windows are provided for your convenience but for additional security you may opt to install and run the worker client manually via the command line. There are directions provided in the README.md file packaged with the installer to do this.
{% endhint %}

## Local Installation for Linux

**Step 1:** Install Docker Engine for your flavor of Linux based on Docker's guide: <https://docs.docker.com/engine/install/>

**Step 2:** Verify Docker Installation

Run the `hello-world` image to verify that Docker is installed correctly:

```bash
sudo docker run hello-world
```

You should see a message saying "Hello from Docker!"

**Step 3:** Manage Docker as a Non-Root User (Optional)

To run Docker commands without `sudo`, add your user to the `docker` group:

```bash
sudo usermod -aG docker $USER
```

Log out and log back in for the changes to take effect.

Test Docker Without `sudo`:

```bash
docker run hello-world
```

**Step 4:** Install NVIDIA Container Toolkit ([Installation Guide](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html))

Required to use NVIDIA GPUs with Docker

1. **Set Up the Package Repository and GPG Key:**

   ```bash
   distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
   curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
   curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
   sudo tee /etc/apt/sources.list.d/nvidia-docker.list
   ```
2. **Update the Package Index:**

   ```bash
   sudo apt-get update
   ```
3. **Install the NVIDIA Docker Package:**

   ```bash
   sudo apt-get install -y nvidia-docker2
   sudo systemctl restart docker
   ```
4. **Test the Installation:**

   ```bash
   docker run --gpus all nvidia/cuda:12.0.1-base-ubuntu22.04 nvidia-smi
   ```

   You should see the output of `nvidia-smi` from within the Docker container.

**Step 5:** Download the Sogni Fast Worker Linux Installer\
**Create Your App Folder**: Download the [Sogni Fast Worker Linux installer](https://api.sogni.ai/v1/download/worker/linux) and extract it into the directory you want to run the service from. \
\
Here is a one line terminal command to download the installer and extract it into a new folder named "sogni-fast-worker" in your current PWD (present working directory):

```
mkdir -p sogni-fast-worker && curl -L "https://api.sogni.ai/v1/download/worker/linux" | tar -xz -C sogni-fast-worker --strip-components=1
```

\
Run `worker-install.sh` and follow the interactive installer steps.

**Running on multiple GPUs**

1. Run `./worker-generator.bat` to generate docker-compose files for each GPU.
2. run `docker compose -f docker-compose-generated.yml up -d`

### Uninstalling Sogni Fast Worker (╯° · °)╯︵ ┻━┻

To uninstall the Sogni Fast Worker, run `worker-uninstall.sh` (Linux) or `worker-uninstall.bat` (Windows). This will:

* Stopped all Sogni Docker containers
* Removed Sogni Docker images

You may then:

* double-click worker-start.bat to start the worker again ┬─┬ノ( º \_ ºノ)
* Uninstall Docker Desktop if you no longer need it.
* Delete the Sogni Fast Worker folder if you wish.
* Reach out to our helpful humans at <app@sogni.ai> for feedback or support (⌐⊙\_⊙)

### Troubleshooting

If you encounter any issues with your Sogni Fast Worker, here are some steps to help diagnose and resolve common problems:

#### Quick Diagnostics

1. **Check Worker Status**\
   Visit [nft.sogni.ai/analytics](https://nft.sogni.ai/analytics) to see:
   * Connection status
   * Daily and lifetime jobs completed
   * Tokens earned
   * Performance metrics
2. **View Live Logs**
   * **Windows**: Double-click `worker-debug.bat`
   * **Linux**: Run `./worker-debug.sh`

## Common Issues

1. **Not Receiving Any Jobs**
   * **Stable Diffusion Worker**: You may need additional models. Rerun the installer to set `AUTO_DOWNLOAD_TO_MIN_MODEL_COUNT` higher, ensuring enough disk space.
   * **Low Job Priority**: If your worker is slow (low GPU performance, slow network, or heavily used GPU), it may be deprioritized.
   * **Still Stuck?** Contact us at <app@sogni.ai>.
2. **Worker Fails to Start or Connect**
   * Verify Docker is running.
   * Check hardware requirements (GPU, RAM, disk).
   * Confirm your API Key and NFT Token ID are correct.
   * Examine logs via `worker-debug.bat` or `worker-debug.sh`.
3. **Worker Disconnects**
   * Check for unstable internet.
   * Confirm your system isn’t going to sleep.
   * Consider a memory diagnostic if your system restarts randomly (gaming rigs with large GPUs can have defective RAM).
   * Review logs for errors.

## Disclaimer

Docker containers run in an isolated environment, separate from your host OS and other containers. While the Sogni Fast Worker is designed with safety in mind, AI image generation is computationally intensive. Ensure adequate cooling and power for extended GPU usage.

**Sogni Fast Worker is beta software**, provided “as is” without any warranty. We have tested it thoroughly (and run it on our own nodes for months), but you assume responsibility for monitoring your system’s health. There is **no guarantee** of earnings or that operational costs will be fully offset. Factors such as hardware, internet speed, and market conditions affect performance and rewards.

If you have concerns or questions, reach out to **<app@sogni.ai>**.

For further support:

* [Discord Community](https://discord.com/invite/2JjzA2zrrc)
* [Sogni Documentation](https://docs.sogni.ai)

Thank you for being part of the Sogni Testnet!

*Last updated: February 16, 2025*

## **Need help? Join our Discord!**

If you have any issues or questions setting up your Sogni Fast Worker you can reach out on Discord or via email to <app@sogni.ai> for technical support.\
\
[Join Sogni Discord](https://discord.com/invite/2JjzA2zrrc) ✨


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://sogni.gitbook.io/sogni-docs/sogni-fast-worker/running-sogni-fast-worker-locally.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.
