Self-hosting
This is a simple guide how to get started with OpenPanel on your own VPS.
Instructions
Prerequisites
- VPS of any kind (only tested on Ubuntu 24.04)
- 🙋♂️ This should work on any system if you have pre-installed docker, node and pnpm
- Clerk.com account (they have a free tier)
Quickstart
Clone
Clone the repository to your VPS
Run the setup script
The setup script will do 3 things
- Install node (if you accept)
- Install docker (if you accept)
- Execute a node script that will ask some questions about your setup
- After this is done you'll need to point a webhook inside Clerk (https://your-domain.com/api/webhook/clerk)
Setup takes 1-2 minutes depending on your VPS
⚠️ If the ./setup
script fails to run, you can do it manually.
- Install docker
- Install node
- Install pnpm
- Run the
npx jiti ./quiz.ts
script inside the self-hosting folder
Start 🚀
Run the ./start
script located inside the self-hosting folder
Clerk.com
Some might wonder why we use Clerk.com for authentication. The main reason for this is that Clerk have great support for iOS and Android apps. We're in the process of building an native app and we want to have a seamless experience for our users.
next-auth is great, but lacks good support for mobile apps.
You'll need to create an account at Clerk.com and create a new project. You'll need the 3 keys that Clerk provides you with.
- Publishable key
pk_live_xxx
- Secret key
sk_live_xxx
- Signing secret
"whsec_xxx"
Webhooks
You'll also need to add a webhook to your domain. We listen on some events from Clerk to keep our database in sync.
URL
- Path:
/api/webhook/clerk
- Example:
https://your-domain.com/api/webhook/clerk
Events we listen to
organizationMembership.created
user.created
organizationMembership.deleted
user.updated
user.deleted
Good to know
Always use correct api url
When self-hosting you'll need to provide your api url when initializing the SDK.
The path should be /api
and the domain should be your domain.
Managed Redis
If you use a managed Redis service, you may need to set the notify-keyspace-events
manually.
Without this setting we wont be able to listen for expired keys which we use for caluclating currently active vistors.
You will see a warning in the logs if this needs to be set manually.