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
- How to Host SillyTavern Using a VPS (For Free!)
- FAQ
- Q: ST doesn't show up on port 8000 when I checked at lsof and grep node.
- Q: When I open up my ST through the Cloudflared Link, it shows a 503 error!
- Q: What if I want to run ST manually if it takes too long to initialize?
- Q: How do I access cloudflared.log?
- Q: Cloudflared.log doesn't have any contents.
- Q: Why use less instead of tail?
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:
- 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.
- 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:
-
Go to https://console.cloud.google.com/welcome
You should see an interface similar to this:
- 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.
- 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:
- 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:
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:
- Update the repository to install packages necessary for this setup, which includes
git, curl, wget, nano, lsof, npm, gnupg, lsb-release
; - Install Node.js, a requirement if you want to run SillyTavern;
- Install SillyTavern and configure ST's
config.yaml
usingnano
as we would need to disable whitelisting to prevent 502 Bad Gateway Error -- preventing you from accessing your set-up. - 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. - Install and set-up
cloudflared
, which is the key to accesslocalhost: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:
- 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".
- 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!
- 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.
Q: When I open up my ST through the Cloudflared Link, it shows a 503 error!
- 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, trycd 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 thenless 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.