Skip to content

Latest commit

 

History

History
358 lines (255 loc) · 10.4 KB

Docker.md

File metadata and controls

358 lines (255 loc) · 10.4 KB
label
Docker

Docker Installation

!!! info This guide assumes you installed SillyTavern in a non-root (non-admin) folder. If you installed SillyTavern in a root folder, you may have to run some of these commands with administrator rights [sudo, doas, Command Prompt (Administrator)]. !!!

Installation

Linux

  1. Install Docker by following the Docker installation guide here. !!! danger Do not install Docker Desktop. !!!

  2. Follow the steps in Manage Docker as a non-root user in the Docker Post-Installation Guide.

  3. Install Git using your package manager.

    • Debian (Ubuntu/Pop! OS/etc.)

      sudo apt install git
    • Arch Linux (Manjaro/EndeavourOS/etc.)

      sudo pacman -S git
    • Fedora, Red Hat Enterprise Linux (RHEL), etc.

      sudo dnf install git
  4. Clone the SillyTavern repository.

    • Release (Stable Branch)

      git clone https://github.com/SillyTavern/SillyTavern && cd SillyTavern/docker
    • Staging (Development Branch)

      git clone https://github.com/SillyTavern/SillyTavern -b staging && cd SillyTavern/docker
  5. Execute docker compose by running the following command within the Docker folder.

    docker compose up -d
  6. Execute the following Docker command to obtain the IP of your SillyTavern Docker container.

    docker network inspect docker_default

    You should receive some sort of output similar to the following below.

    [
        {
            "Name": "docker_default",
            "IPAM": {
                "Config": [
                    {
                        "Subnet": "172.18.0.0/16",
                        "Gateway": "172.18.0.1"
                    }
                ]
            }
        }
    ]

    Copy down the IP you see in Gateway as this will be important.

  7. Using sudo, open nano and run the following command.

    sudo nano config/config.yaml

    Within nano, go down to whitelist. You should see something similar to the following below.

    whitelist:
        - 127.0.0.1

    Add a new line below 127.0.0.1 and put in the IP you copied from Docker. It should look something similar to the following afterwards.

    whitelist:
        - 127.0.0.1
        - 172.18.0.1

    Save the file by pressing Ctrl+S then exit nano by pressing Ctrl+X.

    !!! info Note that if you configured Docker network as a bridge, you could also add external IP addresses to the whitelist as usual. !!!

  8. Restart the Docker Container to apply the new configuration.

    docker compose restart sillytavern
  9. Open an new browser and go to http://localhost:8000. You should see SillyTavern load in a few moments.

  10. Enjoy! :D

Windows

!!! warning Regarding Docker on Windows Using Docker on Windows is really complicated. Not only do you need to activate Windows Subsystem for Linux within Turn Windows features on or off, but also configure your system for Virtualization (Intel VT-d/AMD SVM) which differs from PC manufacturer to PC manufacturer (or motherboard manufacturer). Sometimes, this option is not present on some systems.

It is highly suggested you install SillyTavern by following our Windows guide. This section is a rough idea of how it can be done on Windows. !!!

  1. Install Docker Desktop by following the Docker installation guide here.

  2. Install Git for Windows.

  3. Clone the SillyTavern repository.

    • Release (Stable Branch)

      git clone https://github.com/SillyTavern/SillyTavern && cd SillyTavern/docker
    • Staging (Development Branch)

      git clone https://github.com/SillyTavern/SillyTavern -b staging && cd SillyTavern/docker
  4. Execute docker compose by running the following command within the Docker folder.

    docker compose up -d
  5. Execute the following Docker command to obtain the IP of your SillyTavern Docker container.

    docker network inspect docker_default

    You should receive some sort of output similar to the following below.

    [
        {
            "Name": "docker_default",
            "IPAM": {
                "Config": [
                    {
                        "Subnet": "172.18.0.0/16",
                        "Gateway": "172.18.0.1"
                    }
                ]
            }
        }
    ]

    Copy down the IP you see in Gateway as this will be important.

  6. Running Notepad or a code editor of your choice with administrator rights, go to config and open config.yaml.

    Within the editor of your choice, you should see something similar to the following below.

    whitelist:
        - 127.0.0.1

    Add a new line below 127.0.0.1 and put in the IP you copied from Docker. It should look something similar to the following afterwards.

    whitelist:
        - 127.0.0.1
        - 172.18.0.1

    Save the file by pressing Ctrl+S then exit your editor.

    !!! info Note that if you configured Docker network as a bridge, you could also add external IP addresses to the whitelist as usual. !!!

  7. Restart the Docker Container to apply the new configuration.

    docker compose restart sillytavern
  8. Open an new browser and go to http://localhost:8000. You should see SillyTavern load in a few moments.

  9. Enjoy! :D

macOS

!!! Even though macOS is similar to Linux, it doesn't have the Docker Engine. You will have to install Docker Desktop similarly to Windows. You will also need to install Homebrew in order to install Git on your Mac. This section is a rough idea on how it can be done on macOS. !!!

  1. Install Docker Desktop by following the Docker installation guide here.

  2. Install git using Homebrew.

    brew install git
  3. Clone the SillyTavern repository.

    • Release (Stable Branch)

      git clone https://github.com/SillyTavern/SillyTavern && cd SillyTavern/docker
    • Staging (Development Branch)

      git clone https://github.com/SillyTavern/SillyTavern -b staging && cd SillyTavern/docker
  4. Execute docker compose by running the following command within the Docker folder.

    docker compose up -d
  5. Execute the following Docker command to obtain the IP of your SillyTavern Docker container.

    docker network inspect docker_default

    You should recieve some sort of output similar to the following below.

    [
        {
            "Name": "docker_default",
            "IPAM": {
                "Config": [
                    {
                        "Subnet": "172.18.0.0/16",
                        "Gateway": "172.18.0.1"
                    }
                ]
            }
        }
    ]

    Copy down the IP you see in Gateway as this will be important.

  6. Using sudo, open nano and run the following command.

    sudo nano config/config.yaml

    !!! If you can't run nano, either install it via Homebrew or use TextEdit. !!!

    Within nano, go down to whitelist. You should see something similar to the following below.

    whitelist:
        - 127.0.0.1

    Add a new line below 127.0.0.1 and put in the IP you copied from Docker. It should look something similar to the following afterwards.

    whitelist:
        - 127.0.0.1
        - 172.18.0.1

    Save the file by pressing Ctrl+S then exit nano by pressing Ctrl+X.

    !!! info Note that if you configured Docker network as a bridge, you could also add external IP addresses to the whitelist as usual. !!!

  7. Restart the Docker Container to apply the new configuration.

    docker compose restart sillytavern
  8. Open an new browser and go to http://localhost:8000. You should see SillyTavern load in a few moments.

  9. Enjoy! :D

Configuring SillyTavern

SillyTavern's configuration file (config.yaml) will be located within the config folder. Configuring the config file should be no different than configuring it without Docker, however you will need to run nano or a code editor with administrator rights in order to save your changes.

!!! warning Don't forget to restart the Docker container for SillyTavern in order to apply your changes! Make sure you execute this command within the docker folder.

docker compose restart sillytavern

!!!

Locating User Data

SillyTavern's data folder will be within the data folder. Backing up your files should be easy to do, however, restoring or adding content into it may require you to do so with administrator rights.

Running Server Plugins

Running plugins like HoYoWiki-Scraper-TS or SillyTavern-Fandom-Scraper within Docker is no different from running it on your system without Docker, however we will need to do a slight modification to the Docker Compose script in order to do so.

!!! Note If you already see a plugins folder within the docker folder, you can skip Steps 1-2. !!!

  1. Using nano or a code editor, open docker-compose.yml and add the following line below volumes.

        volumes:
            - "./config:/home/node/app/config"
            - "./data:/home/node/app/data"
            - "./plugins:/home/node/app/plugins"
  2. Create a new folder within the docker folder called plugins.

  3. Follow your plugin's instructions on installing the plugin.

  4. Using nano or a code editor with administrator rights, open config.yaml (within the config folder) and enable enableServerPlugins

    enableServerPlugins: true
  5. Restart the Docker container.

    docker compose restart sillytavern
  6. Profit.