Self-hosting TikTokSaver gives you full control over the deployment environment, custom domain, and resource limits. The application consists of two independent pieces: the Express API inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/KevxxAlva/tiktok-bot-downloader/llms.txt
Use this file to discover all available pages before exploring further.
api/ and the compiled React frontend in client/dist/. You run the API as a long-lived background process and point a reverse proxy — Nginx or Caddy — at both the static files and the API, so everything is served from a single origin.
Prerequisites
Before you begin, make sure your server has the following available:- Bun v1.0+ (recommended) or Node.js 18+ — the API is a CommonJS Express app that runs on either runtime.
- A Linux server or VPS with a public IP address (Ubuntu 22.04 LTS or Debian 12 are well tested).
gitinstalled and network access to clone the repository.- A reverse proxy — Nginx or Caddy — installed and able to bind to ports 80 and 443.
Setup
Install dependencies
The monorepo provides dedicated root-level scripts to install dependencies for each workspace independently. Run both before building:These scripts are defined in the root
package.json:Build the frontend
Compile the Vite + React application into static assets. The output lands in This runs
client/dist/.cd client && bun run build, which executes bun tsc && bun vite build inside the client/ workspace. After it completes, verify the output exists:Start the API server
The API is started with the This runs The port binding comes directly from Confirm the server is running:
start script inside api/:bun index.js. By default the server listens on port 3000. Override the port by setting the PORT environment variable before starting:api/index.js:Configure a reverse proxy
Serve the compiled frontend from Enable the site and reload Nginx:
client/dist/ as the document root and proxy all /api/* requests to the running Express server. Choose the proxy that fits your setup.Nginx
Create a new site configuration at/etc/nginx/sites-available/tiktoksaver:Running the API as a background process
Thebun start command in the foreground will stop when you close your SSH session. Use a process manager to keep the API running persistently.
pm2
systemd
Create a unit file at/etc/systemd/system/tiktoksaver.service:
CORS considerations
pm2 documentation
Full reference for managing Node.js / Bun processes with pm2, including cluster mode and log rotation.
Caddy documentation
Learn how Caddy’s automatic HTTPS and reverse proxy directives work for production deployments.