#Reverse proxying
Note
This section does not refer to OpenAI/Claude reverse proxies. This refers exclusively to HTTP/HTTPS Reverse Proxies.
Is Termux confusing to setup? Are you tired of updating and installing ST on every device you have? Want organization of your chats and characters? Well you are in luck. This guide will hopefully cover how to host SillyTavern on your PC where you can connect from anywhere and chat to your bots on the same PC you use to run AI models!
Warning
This guide is not meant for beginners. This will be very technical.
#Fair Warning
For Windows Users
This guide is not for Windows users. We recommend using a Linux VM or WSL2 to follow this guide.
For Linux Users
You must have prior knowledge of
- Linux console commands
- DNS Records
- Public IP addresses
- Docker
You will have to buy a domain for yourself and configure a CNAME
for your SillyTavern page. We suggest adding or buying the domain on Cloudflare as this guide will cover how to do this with Cloudflare itself.
#Installation
#Linux (Bare-Metal SillyTavern)
For Linux, we will reverse proxying SillyTavern through Traefik. There are other options such as NGINX or Caddy, but for this guide, we will use Traefik as it is what we use ourselves.
Get the private IP of your computer using
ifconfig
or from your router.Tip
It is recommended to set your private IP to a Static IP. Refer to your router's manual or Google to configure static IPs.
Get your public IP of your modem by Googling
what's my ip
.About Public IPs
Most residential/home networks use Dynamic IPs which are renewed after months of use. If you have a dynamic IP, use either DDClient or remember to check and change your public IP ever so often on the Cloudflare Dashboard.
Install Docker by following the Docker installation guide here.
Note
Do not install Docker Desktop.
Follow the steps in Manage Docker as a non-root user in the Docker post-installation guide here.
Go to your root folder in Linux and make a new folder named
docker
.Execute
chown
, replacingwith your Linux username to set the permissions in the docker folder. Make a folder inside the docker folder, that being
secrets
and inside secrets beingcloudflare
.Make a folder inside the docker folder, that being
appdata
and inside appdata beingtraefik
. Enter theappdata/traefik
folder afterwards.Create a acme.json file using
touch
and set the permissions of it to 600.Using
nano
or a similar editor, create a file name traefik.yml and paste the following. Replace the template email with your own, then save the file.Return back to the
docker
folder.Using
nano
or a similar editor, create a file name docker-compose.yaml and paste the following. Save the file afterwards.Login to Cloudflare and click on your Domain, followed by Get your API token.
Click on Create Token then Create Custom Token and make sure you give your token the following permissions.
Token Permissions
Zone -> DNS -> Edit
Zone -> Zone -> Read
Click on Continue to summary followed by Create Token.
Copy the Token Key given to you and store it somewhere secure.
cd
intosecrets/cloudflare
and usingnano
or a similar editor, create a file named CF_DNS_API_KEY and paste your key inside.Return to your domain page and go to DNS. Create a new record using Add record and create two A type keys like the ones below. Replace
PUBLIC_IP
with your own public IP, then click Save.Create another record of the
CNAME
type, then click Save. Here is an example on how it should appear on the Cloudflare dashboard.cd
into appdata/traefik and usingnano
or a similar editor, create a file name config.yml and paste the following. ReplacePRIVATE_IP
with the private IP you obtained, andsilly.DOMAIN.com
with the name of your subdomain and domain page, then save the file.Run Docker Compose using the following commands:
Go to your SillyTavern folder and edit
config.yaml
to enable listen mode and basic authentication, whilst disablingwhitelistMode
.Tip
Make sure to change the default username and password to something strong that you can remember.
Or to use the SillyTavern accounts as usernames and passwords:
Tip
Before enabling perUserBasicAuth ensure you have a valid multi-user setup with working passwords.
Wait a few minutes, then open your domain page you made for ST. At the end of it, you should be able to open SillyTavern from anywhere you go just with one URL and one account.
Tip
If nothing happens after several minutes, check the container logs for Traefik for any possible errors.
Enjoy! :D
#Linux (Docker SillyTavern)
Note
Do note that we run SillyTavern on bare-metal over Docker. This is a rough idea of what we would do on Docker with other Docker containers we tend to use with ST.
Follow Steps 1-11 of Linux (Bare-Metal SillyTavern).
Login to Cloudflare and click on your Domain, followed by Get your API token.
Click on Create Token then Create Custom Token and make sure you give your token the following permissions.
Token Permissions
Zone -> DNS -> Edit
Zone -> Zone -> Read
Click on Continue to summary followed by Create Token.
Copy the Token Key given to you and store it somewhere secure.
cd
intosecrets/cloudflare
and usingnano
or a similar editor, create a file named CF_DNS_API_KEY and paste your key inside.Return to your domain page and go to DNS. Create a new record using Add record and create two A type keys like the ones below. Replace
PUBLIC_IP
with your own public IP and the example domain with your domain, then click Save.Create another record of the
CNAME
type, then click Save. Here is an example on how it should appear on the Cloudflare dashboard.Git clone SillyTavern into the
docker
folder.Using
nano
or a similar editor, create a file name docker-compose.yaml and paste the following. Replacesilly.DOMAIN.com
with the subdomain you added above, the save the file afterwards.Run Docker Compose using the following commands:
Stop the SillyTavern Docker container.
Go to your SillyTavern folder (
appdata/sillytavern/config
) and editconfig.yaml
to enable listen mode and basic authentication, whilst disablingwhitelistMode
.Tip
Make sure to change the default username and password to something strong that you can remember.
Start the SillyTavern Docker container again.
Wait a few minutes, then open your domain page you made for ST. At the end of it, you should be able to open SillyTavern from anywhere you go just with one URL and one account.
Tip
If nothing happens after several minutes, check the container logs for Traefik for any possible errors.
Enjoy! :D
#Updating your Cloudflare DNS
DDClient allows you to sync your public IP to Cloudflare in the situation that your ISP changes it, allowing you to continue accessing your ST instance as if nothing ever happened.