Every analytics tool wants a subscription. And your data. I built Twiligent instead. YouTube stats. Instagram stats. One dashboard. Runs locally on your machine.
export const meta = { title: 'Self-hosting overview', description: 'What you need to run your own Twiligent, what it costs, and the order to set it up in.' }
<Callout type="note" title="Only the administrator follows this section">
If you signed in to a Twiligent link someone gave you, you do not need any of this. The server, the keys and scheduling are already handled. Read [Using Twiligent](/docs/use/getting-started) instead.
</Callout>
## How the pieces fit
Twiligent has two parts. The **frontend** is the website people sign in to, hosted on Cloudflare Pages. The **backend** is a Cloudflare Worker that talks to YouTube and Instagram, stores data in Supabase, and publishes scheduled posts every 15 minutes, trying again when Instagram has a passing problem. All secrets live in the backend; the frontend only holds values that are safe to be public.
The repository has a third folder, `site`, which is the project's own public website and these docs. You do not need it to run Twiligent.
## Accounts you need
| Service | Needed for | | Cost |
| --- | --- | --- | --- |
| Supabase | Sign-in and the database | <Badge tone="required">Required</Badge> | Free plan is enough |
| Cloudflare | Hosting the backend and frontend | <Badge tone="required">Required</Badge> | Free plan is enough |
| Google Cloud | YouTube analytics | <Badge tone="optional">For YouTube</Badge> | Free, 10,000 quota units a day |
| Meta for Developers | Connecting Instagram, publishing, and replying to comments | <Badge tone="optional">For Instagram</Badge> | Free; comment replies need App Review |
| Cloudinary | Hosting media before Instagram fetches it | <Badge tone="optional">For publishing</Badge> | Free plan is enough |
| Upstash | Caching to save API quota and speed pages up | <Badge tone="optional">Optional</Badge> | Free plan is enough |
| Resend | Emailing sign-in and verification codes to members | <Badge tone="optional">Optional</Badge> | Free, 100 emails a day |
| GitHub | Deploy on every push, and a backup scheduler | <Badge tone="optional">Optional</Badge> | Free |
## Order of setup
1. [Supabase](/docs/self-host/supabase): create the project, then create the tables with `npm run db:push`.
2. [YouTube API key](/docs/self-host/youtube), [Instagram app](/docs/self-host/instagram), [Cloudinary](/docs/self-host/cloudinary) and optionally [Upstash Redis](/docs/self-host/redis), in any order. [Comment automation](/docs/self-host/comment-automation) comes after the Instagram app and the backend are deployed.
3. [Deploy the backend](/docs/self-host/deploy-backend) and give it every secret.
4. [Deploy the frontend](/docs/self-host/deploy-frontend).
5. Optionally connect [GitHub](/docs/self-host/github), then run through the [launch checklist](/docs/self-host/checklist).
Keep a private note open while you work. Each page tells you which values to copy, and [Environment variables](/docs/reference/environment) lists all of them in one table.
## What you need on your computer
- Node.js 22.18 or newer, and Git. The tests and the backup scheduler script are TypeScript files that Node runs directly, which older versions cannot do.
- A copy of the code: `git clone https://github.com/spacesdrive/twiligent.git`
- The project's packages: run `npm install` once in the cloned `twiligent` folder. It installs the backend, the website and the Wrangler command used to deploy them.