How to Host SillyTavern Using a VPS (For Free!)

Created by: @mitzuyodaaaa (on Discord) | @thevonstitution (on X)

Hello hoomans! This guide is designed for people who wants to use SillyTavern anytime, anywhere. For this guideline, we'll be using Google Cloud. You are free to use any other VPS providers granted that you are sure to yourself that it is safe to use and encrypts your data pretty well. This is a one-time set-up, so after this, you might not touch your Virtual Machine again! (for the most part).

TABLE OF CONTENTS


Why would you want to have this set up?

I'm not here to sell you on the premises and value propositions, but what I can tell you is that:

1) After setting this up, you can access SillyTavern on any devices using a secure website link that's designed to run anytime, anywhere!
2)
No need to connect on the same Wi-Fi/Internet
. Since this basically hosts ST on a Google Server, you can just get a Cloudflared link to access your ST and RP with your bots.

3) It's a one-time set-up. Since Google is not much known for shutting down their servers, then it is pretty much in the 95% confidence that this will run indefinitely.


Pre-requisites (What do you Need?):

a) a Google account

  • for obvious reasons. You'll need to have a Google account for it to work. Otherwise, you might want to look for other VPS Providers that will suit your needs (I suggest Oracle Cloud as a Free Alternative.);

b) Debit/Credit Card

  • You might want to invest on one if you don't have any, as this tutorial will make you commit to a free trial to Google for 90 days with free $300 credits.

Take Note of the following:

  1. If you're going to use those credits, it's up to you, but what we're making is not subject to GCP's Paid Plan. Otherwise, it will bill on your registered debit/credit card. You have been warned.
  2. It's best to have at least two debit/credit cards. I was fortunate to have 2 cards with me, which enabled me to access GCP's Free Trial.

Phase 1: Setting Up your Virtual Machine (Instance)

In a nutshell, a virtual machine is like having a computer but on cloud. Cloud is basically the internet hosted on remote "servers" that has the capability to store or process your data. A VM runs on cloud, which makes it possible for you to essentially run a computer without having a second computer, albeit with certain limitations and restrictions. But that's a whole new topic that is not needed to be discussed on this article.

Without further ado, let's explore the steps you need to follow:

Note:

This assumes that you have already set up your Google Account and Debit/Credit Card Payment. So for this, we'll move on directly to the specifics.

Part A: Foundations + Prerequisites

Instructions:

  1. Go to https://console.cloud.google.com/welcome

    You should see an interface similar to this:
    GCP.png


  1. Click on "Try for Free" -- and fill out the required information. By this point, you should be able to acquire the $300 in credit that you can optionally use within 90 days. NOTE: You are NOT mandated to input your TAX Information! At least from my understanding.

  1. Creating a Virtual Machine on GCP requires you to make a project first. To do this, click on "Select a project" and name your project to your liking. The interface should look similar to this:
    Project.png

  1. After which, you can go to "Create a VM" to create an instance.
    If you can't see or don't know where it is, refer here instead.
    Your screen should look like this:
    Sample.png

Part B: Setting Up Your Virtual Machine

In this section, you'll be guided on the processes involved in creating an instance (a virtual machine) which falls under the Free Plan of Google Cloud.

You should see a bunch of configuration options on your screen (as evident on the picture above), divided in multiple categories.

Note:

Take note that misconfiguring one of these steps can and will bill on your cards if you are not careful enough. Proceed with utmost caution.


MACHINE CONFIGURATION

Try to find and change the specification to the ff. details:

Specification Details
Machine Type e2-micro (2 vCPU, 1 core, 1 GB memory)
Region (IMPORTANT: MUST BE ONE OF THE FF. REGIONS ONLY!) us-west1, us-central1, us-east1
Zone Any zone would suffice

OS and STORAGE

Reminders [Click "CHANGE" by the way]:

a) Operating System: You may choose any of the Debian and Ubuntu Distros, please don't pick Windows Server, the OS needs licensing so you'd be locked out if you don't have license for Windows. I personally opted for Ubuntu 24.04 LTS.

  • Please use x86-based systems instead of ARM64. You should be able to see that on the description.
  • I TRIED using Debian (bookworm), but for some reason, when I run the script (the script lies on Phase 2: Setting Up the Virtual Machine), it was just arduously slow, so much so that I gave up despite Debian using less resource than Ubuntu, albeit marginal. But since the copy-paste-able script I provided works on Debian-based distros (like Ubuntu), you can try it to your discretion.

b) For Storage: You may choose up to 30 GB of storage and it's still free. The Boot Disk Type should be set at "Balanced Persistent Disk."


DATA PROTECTION

Do not touch this unless you know what you are doing, it's essentially backing up snapshots, which acts as a backup for your Operating System in case something goes wrong (i.e: accidental deletion of system files, random errors, etc.).


NETWORKING

Tick/Click the ff. on:

  • Allow HTTP traffic
  • Allow HTTPS traffic

Note: You can play with the settings if you know what you're doing.


OBSERVABILITY

Tick/Click the ff. on:

  • [ ] Install Ops Agent for Monitoring and Logging

SECURITY AND ADVANCED

Do not touch this unless you know what you are doing. Unless you're security and privacy-conscious, then you might play around with this. This is beyond my knowledge though, therefore I'm afraid I cannot help with those concerns.

After that, just hit "Create"!


Then... voila! Your instance should have been created by now. Congrats!


Phase 2: Setting Up the Virtual Machine

For this portion, you're basically going to SSH inside your virtual machine and run a script that will hopefully do the following constituents:

  1. Update the repository to install packages necessary for this setup, which includes git, curl, wget, nano, lsof, npm, gnupg, lsb-release;
  2. Install Node.js, a requirement if you want to run SillyTavern;
  3. Install SillyTavern and configure ST's config.yaml using nano as we would need to disable whitelisting to prevent 502 Bad Gateway Error -- preventing you from accessing your set-up.
  4. Create a systemd file to run SillyTavern as a serv file for automatic start up in case the virtual machine decides to restart for one reason or another.
  5. Install and set-up cloudflared, which is the key to access localhost:8000 on HTTPS-secured protocol.

I'm not going to let you guys run lines per code one by one, as I'm pretty sure the majority who comes across this guide won't want to read a 10-page documentation as to why this or that works. If you are that person, I highly suggest asking ChatGPT or Claude for details, as I am NOT going to explain all that like that nerdy guy at school 🤓.

Instructions:

  1. After creation, hover over your newly created instance and hit "SSH". A new tab will open, which will ask you to authorize the SSH keys, just hit "Authorize".
    SSH.png

  1. Run this code (copy it below then paste it on your CLI!):

Reminder:

This code assumes that you are the only one accessing this website. If you want more security measures implicated on your ST, then feel free to change the code based on your needs!

# 1) Update & install essentials
sudo apt-get update && sudo apt upgrade -y
sudo apt-get install -y git curl wget nano lsof npm gnupg lsb-release

# 1.5) Run Node.js setup separately to ensure latest LTS (Node 20)
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs

# 2) Clone SillyTavern (if not present) and install dependencies
cd ~
if [ ! -d ~/SillyTavern ]; then
  git clone https://github.com/SillyTavern/SillyTavern.git ~/SillyTavern
fi
cd ~/SillyTavern
npm install

# 3) Create SillyTavern config.yaml and disable whitelist
sudo tee ~/SillyTavern/config.yaml > /dev/null <<EOF
# SillyTavern configuration file
whitelistMode: false
whitelist:
  - 0.0.0.0/0
EOF

# 4) Create systemd service (only if systemd is available)
if pidof systemd >/dev/null 2>&1; then
  sudo tee /etc/systemd/system/sillytavern.service > /dev/null <<EOF
[Unit]
Description=SillyTavern Server
After=network.target

[Service]
ExecStart=/usr/bin/npm start
WorkingDirectory=$HOME/SillyTavern
Restart=always
User=$USER
Environment=NODE_ENV=production
Environment=PATH=/usr/local/bin:/usr/bin:/bin

[Install]
WantedBy=multi-user.target
EOF

  sudo systemctl daemon-reload
  sudo systemctl enable sillytavern
  sudo systemctl start sillytavern

  # Wait for SillyTavern to initialize
  sleep 5

  # Verify it's running
  if sudo lsof -i :8000 >/dev/null 2>&1; then
    echo "✅ SillyTavern is running on port 8000"
  else
    echo "⚠️ SillyTavern not detected on port 8000. Check logs: sudo journalctl -u sillytavern -n 50 or sudo lsof -i :8000"
  fi
else
  echo "⚠️ systemd not detected — you'll need to run SillyTavern manually or via tmux."
fi

# 5) Install Cloudflared manually (UBUNTU + DEBIAN PROVEN!)
curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb -o cloudflared-linux-amd64.deb
sudo dpkg -i cloudflared-linux-amd64.deb || sudo apt --fix-broken install -y
rm cloudflared-linux-amd64.deb

# 6) Display instructions
echo ""
echo "======================================================"
echo "✅ SillyTavern installed and started (port 8000)"
echo "⚠️ NOTE: SillyTavern will not run immediately after the completion of this script."
echo "To check the status of port 8000, use:"
echo "  sudo lsof -i :8000"
echo ""
echo "a) To check the status of SillyTavern itself (using systemd), use:"
echo "sudo systemctl status sillytavern"
echo ""
echo "a) To check the status of SillyTavern itself (looking at nodejs running resources), use:"
echo "ps aux | grep node"
echo ""
echo "To start Cloudflared in the background and check its logs for the link, use:"
echo "  nohup cloudflared tunnel --url http://localhost:8000 > cloudflared.log 2>&1 &"
echo ""
echo "To check logs, use:"
echo "  less cloudflared.log"
echo ""
echo "The website URL should look like this:"
echo "https://<random-subdomain>.trycloudflare.com"
echo ""
echo "Enjoy, hooman! (Follow @thevonstitution on X!)"
echo "======================================================"

  1. Follow the instructions after the script finishes everything!

And you're done!

Reminder:

As shown on the CLI, SillyTavern will not run immediately after the completion of this script. Give it time to initialize, maximum of at least 5 minutes.

FAQ


Q: ST doesn't show up on port 8000 when I checked at lsof and grep node.

  • A: Learn the art of patiently waiting. At maximum—5-7 minutes. By then, you should look at it again for yourself.
  • A: This means ST is either not running on the background or it's currently loading its resources before it initializes on localhost:8000. Try using: sudo lsof -i :8000 - this will check if ST is running on background or not. If not, try waiting, as aforementioned above.

Q: What if I want to run ST manually if it takes too long to initialize?

  • A: If, for one reason or another, ST does NOT initialize, try manually starting ST by doing npm start on the SillyTavern folder. To navigate, try cd SillyTavern if you are on home folder. No need to do this if you're on /SillyTavern/ folder.

Q: How do I access cloudflared.log?

  • A: Run nohup cloudflared tunnel --url http://localhost:8000 > cloudflared.log 2>&1 & and then less cloudflared.log and then scroll up to find your URL.

Q: Cloudflared.log doesn't have any contents.

  • A: If the log is empty, give it some ample time, about 10-15 seconds. By then the contents should have loaded by now. Then it's your time to use less cloudflared.log.

Q: Why use less instead of tail?

  • A: You could use tail cloudflare.log, but you wouldn't be able to see all the contents. You'd have to modify it first before you can see it. less does the work for you.

If you have more questions, hop in and ask me on Discord. This article is still a work in progress! Feedbacks would be appreciated.

Edit

Pub: 06 Oct 2025 17:53 UTC

Edit: 07 Oct 2025 08:20 UTC

Views: 194