Skip to content

Commit 3158ebf

Browse files
committed
chore: prep v2 self-hosting
1 parent d7c6e88 commit 3158ebf

File tree

9 files changed

+152
-29
lines changed

9 files changed

+152
-29
lines changed
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
title: Migration from v1 to v2
3+
description: Finally we feel ready to release v2 for all self-hostings. This is a big one!
4+
---
5+
6+
## What's New in v2
7+
8+
- **Redesigned dashboard** - New UI built with Tanstack
9+
- **Revenue tracking** - Track revenue alongside your analytics
10+
- **Sessions** - View individual user sessions
11+
- **Real-time view** - Live event stream
12+
- **Customizable dashboards** - Grafana-style widget layouts
13+
- **Improved report builder** - Faster and more flexible
14+
- **General improvements** - We have also made a bunch of bug fixes, minor improvements and much more
15+
16+
## Migrating from v1
17+
18+
### Ensure you're on the self-hosting branch
19+
20+
Sometimes we add new helper scripts and what not. Always make sure you're on the latest commit before continuing.
21+
22+
```bash
23+
cd ./self-hosting
24+
git fetch origin
25+
git checkout self-hosting
26+
git pull origin self-hosting
27+
```
28+
29+
### Envs
30+
31+
Since we have migrated to tanstack from nextjs we first need to update our envs. We have added a dedicated page for the [environment variables here](/docs/self-hosting/environment-variables).
32+
33+
```js title=".env"
34+
NEXT_PUBLIC_DASHBOARD_URL="..." // [!code --]
35+
NEXT_PUBLIC_API_URL="..." // [!code --]
36+
NEXT_PUBLIC_SELF_HOSTED="..." // [!code --]
37+
38+
DASHBOARD_URL="..." // [!code ++]
39+
API_URL="..." // [!code ++]
40+
SELF_HOSTED="..." // [!code ++]
41+
```
42+
43+
### Clickhouse 24 -> 25
44+
45+
We have updated Clickhouse to 25, this is important to not skip, otherwise your OpenPanel instance wont work.
46+
47+
You should edit your `./self-hosting/docker-compose.yml`
48+
49+
```js title="./self-hosting/docker-compose.yml"
50+
services:
51+
op-ch:
52+
image: clickhouse/clickhouse-server:24.3.2-alpine // [!code --]
53+
image: clickhouse/clickhouse-server:25.10.2.65 // [!code ++]
54+
```
55+
56+
Since version 25 clickhouse enabled default user setup, this means that we need to disable it to avoid connection issues. With this setting we can still access our clickhouse instance (internally) without having a user.
57+
58+
```
59+
services:
60+
op-ch:
61+
environment:
62+
- CLICKHOUSE_SKIP_USER_SETUP=1
63+
```
64+
65+
### Use our latest docker images
66+
67+
Last thing to do is to start using our latest docker images.
68+
69+
> Note: Before you might have been using the latest tag, which is not recommended. Change it to the actual latest version instead.
70+
71+
```js title="./self-hosting/docker-compose.yml"
72+
services:
73+
op-api:
74+
image: lindesvard/openpanel-api:latest // [!code --]
75+
image: lindesvard/openpanel-api:2.0.0 // [!code ++]
76+
77+
op-worker:
78+
image: lindesvard/openpanel-worker:latest // [!code --]
79+
image: lindesvard/openpanel-worker:2.0.0 // [!code ++]
80+
81+
op-dashboard:
82+
image: lindesvard/openpanel-dashboard:latest // [!code --]
83+
image: lindesvard/openpanel-dashboard:2.0.0 // [!code ++]
84+
```
85+
86+
### Done?
87+
88+
When you're done with above steps you should need to restart all services. This will take quite some time depending on your hardware and how many events you have. Since we have made significant changes to the database schema and data we need to run migrations.
89+
90+
```bash
91+
./stop
92+
./start
93+
```
94+
95+
## Using Coolify?
96+
97+
If you're using Coolify and running OpenPanel v1 you'll need to apply the above changes. You can take a look at our [Coolify PR](https://github.com/coollabsio/coolify/pull/7653) which shows what you need to change.
98+
99+
## Any issues with migrations?
100+
101+
If you stumble upon any issues during migrations, please reach out to us on [Discord](https://discord.gg/openpanel) and we'll try our best to help you out.

apps/public/content/docs/self-hosting/changelog.mdx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@ title: Changelog for self-hosting
33
description: This is a list of changes that have been made to the self-hosting setup.
44
---
55

6+
## 2.0.0
7+
8+
We have released the first stable version of OpenPanel v2. This is a big one!
9+
10+
Read more about it in our [migration guide](/docs/migration/migrate-v1-to-v2).
11+
12+
TLDR;
13+
14+
- Clickhouse upgraded from 24.3.2-alpine to 25.10.2.65
15+
- Add `CLICKHOUSE_SKIP_USER_SETUP=1` to op-ch service
16+
- `NEXT_PUBLIC_DASHBOARD_URL` -> `DASHBOARD_URL`
17+
- `NEXT_PUBLIC_API_URL` -> `API_URL`
18+
- `NEXT_PUBLIC_SELF_HOSTED` -> `SELF_HOSTED`
19+
620
## 1.2.0
721

822
We have renamed `SELF_HOSTED` to `NEXT_PUBLIC_SELF_HOSTED`. It's important to rename this env before your upgrade to this version.
@@ -30,7 +44,7 @@ If you upgrading from a previous version, you'll need to edit your `.env` file i
3044

3145
### Removed Clickhouse Keeper
3246

33-
In 0.0.6 we introduced a cluster mode for Clickhouse. This was a misstake and we have removed it.
47+
In 0.0.6 we introduced a cluster mode for Clickhouse. This was a mistake and we have removed it.
3448

3549
Remove op-zk from services and volumes
3650

apps/public/content/docs/self-hosting/deploy-coolify.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ Coolify automatically handles these variables:
109109
- `DATABASE_URL`: PostgreSQL connection string
110110
- `REDIS_URL`: Redis connection string
111111
- `CLICKHOUSE_URL`: ClickHouse connection string
112-
- `NEXT_PUBLIC_API_URL`: API endpoint URL (set via `SERVICE_FQDN_OPAPI`)
113-
- `NEXT_PUBLIC_DASHBOARD_URL`: Dashboard URL (set via `SERVICE_FQDN_OPDASHBOARD`)
112+
- `API_URL`: API endpoint URL (set via `SERVICE_FQDN_OPAPI`)
113+
- `DASHBOARD_URL`: Dashboard URL (set via `SERVICE_FQDN_OPDASHBOARD`)
114114
- `COOKIE_SECRET`: Automatically generated secret
115115

116116
You can configure optional variables like `ALLOW_REGISTRATION`, `RESEND_API_KEY`, `OPENAI_API_KEY`, etc. through Coolify's environment variable interface.

apps/public/content/docs/self-hosting/deploy-docker-compose.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ If you want to use specific image versions, edit the `docker-compose.yml` file a
126126

127127
```yaml
128128
op-api:
129-
image: lindesvard/openpanel-api:v1.0.0 # Specify version
129+
image: lindesvard/openpanel-api:2.0.0 # Specify version
130130
```
131131
132132
### Scaling Workers

apps/public/content/docs/self-hosting/deploy-dokploy.mdx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ Edit the `.env` file or environment variables in Dokploy. You **must** set these
5454

5555
```bash
5656
# Required: Set these to your actual domain
57-
NEXT_PUBLIC_API_URL=https://yourdomain.com/api
58-
NEXT_PUBLIC_DASHBOARD_URL=https://yourdomain.com
57+
API_URL=https://yourdomain.com/api
58+
DASHBOARD_URL=https://yourdomain.com
5959

6060
# Database Configuration (automatically set by Dokploy)
6161
OPENPANEL_POSTGRES_DB=openpanel-db
@@ -71,7 +71,7 @@ [email protected]
7171
```
7272

7373
<Callout type="warn">
74-
⚠️ **Critical**: Unlike Coolify, Dokploy does not support `SERVICE_FQDN_*` variables. You **must** hardcode `NEXT_PUBLIC_API_URL` and `NEXT_PUBLIC_DASHBOARD_URL` with your actual domain values.
74+
⚠️ **Critical**: Unlike Coolify, Dokploy does not support `SERVICE_FQDN_*` variables. You **must** hardcode `API_URL` and `DASHBOARD_URL` with your actual domain values.
7575
</Callout>
7676
</Step>
7777

@@ -133,8 +133,8 @@ If you're using Cloudflare in front of Dokploy, remember to purge the Cloudflare
133133

134134
For Dokploy, you **must** hardcode these variables (unlike Coolify, Dokploy doesn't support `SERVICE_FQDN_*` variables):
135135

136-
- `NEXT_PUBLIC_API_URL` - Full API URL (e.g., `https://analytics.example.com/api`)
137-
- `NEXT_PUBLIC_DASHBOARD_URL` - Full Dashboard URL (e.g., `https://analytics.example.com`)
136+
- `API_URL` - Full API URL (e.g., `https://analytics.example.com/api`)
137+
- `DASHBOARD_URL` - Full Dashboard URL (e.g., `https://analytics.example.com`)
138138

139139
Dokploy automatically sets:
140140
- `OPENPANEL_POSTGRES_DB` - PostgreSQL database name
@@ -166,9 +166,9 @@ If API requests fail after deployment:
166166

167167
1. **Verify environment variables**:
168168
```bash
169-
# Check that NEXT_PUBLIC_API_URL is set correctly
170-
docker exec <op-api-container> env | grep NEXT_PUBLIC_API_URL
171-
docker exec <op-dashboard-container> env | grep NEXT_PUBLIC_API_URL
169+
# Check that API_URL is set correctly
170+
docker exec <op-api-container> env | grep API_URL
171+
docker exec <op-dashboard-container> env | grep API_URL
172172
```
173173

174174
2. **Check "Strip external path" setting**:
@@ -188,7 +188,7 @@ If account creation fails:
188188
# In Dokploy, view logs for op-api service
189189
```
190190

191-
2. Verify `NEXT_PUBLIC_API_URL` matches your domain:
191+
2. Verify `API_URL` matches your domain:
192192
- Should be `https://yourdomain.com/api`
193193
- Not `http://localhost:3000` or similar
194194

@@ -240,7 +240,7 @@ The Dokploy template differs from Coolify in these ways:
240240

241241
1. **Environment Variables**:
242242
- Dokploy does not support `SERVICE_FQDN_*` variables
243-
- Must hardcode `NEXT_PUBLIC_API_URL` and `NEXT_PUBLIC_DASHBOARD_URL`
243+
- Must hardcode `API_URL` and `DASHBOARD_URL`
244244

245245
2. **Domain Configuration**:
246246
- Must manually configure domain paths

apps/public/content/docs/self-hosting/environment-variables.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Remove `convert_any_join` from ClickHouse settings. Used for compatibility with
116116

117117
## Application URLs
118118

119-
### NEXT_PUBLIC_API_URL
119+
### API_URL
120120

121121
**Type**: `string`
122122
**Required**: Yes
@@ -126,10 +126,10 @@ Public API URL exposed to the browser. Used by the dashboard frontend and API se
126126

127127
**Example**:
128128
```bash
129-
NEXT_PUBLIC_API_URL=https://analytics.example.com/api
129+
API_URL=https://analytics.example.com/api
130130
```
131131

132-
### NEXT_PUBLIC_DASHBOARD_URL
132+
### DASHBOARD_URL
133133

134134
**Type**: `string`
135135
**Required**: Yes
@@ -139,7 +139,7 @@ Public dashboard URL exposed to the browser. Used by the dashboard frontend and
139139

140140
**Example**:
141141
```bash
142-
NEXT_PUBLIC_DASHBOARD_URL=https://analytics.example.com
142+
DASHBOARD_URL=https://analytics.example.com
143143
```
144144

145145
### API_CORS_ORIGINS
@@ -368,7 +368,7 @@ SLACK_STATE_SECRET=your-state-secret
368368

369369
## Self-hosting
370370

371-
### NEXT_PUBLIC_SELF_HOSTED
371+
### SELF_HOSTED
372372

373373
**Type**: `boolean`
374374
**Required**: No
@@ -378,7 +378,7 @@ Enable self-hosted mode. Set to `true` or `1` to enable self-hosting features. U
378378

379379
**Example**:
380380
```bash
381-
NEXT_PUBLIC_SELF_HOSTED=true
381+
SELF_HOSTED=true
382382
```
383383

384384
## Worker & Queue
@@ -784,8 +784,8 @@ For a basic self-hosted installation, these variables are required:
784784
- `DATABASE_URL` - PostgreSQL connection
785785
- `REDIS_URL` - Redis connection
786786
- `CLICKHOUSE_URL` - ClickHouse connection
787-
- `NEXT_PUBLIC_API_URL` - API endpoint URL
788-
- `NEXT_PUBLIC_DASHBOARD_URL` - Dashboard URL
787+
- `API_URL` - API endpoint URL
788+
- `DASHBOARD_URL` - Dashboard URL
789789
- `COOKIE_SECRET` - Session encryption secret
790790

791791
### Optional but Recommended

apps/public/content/docs/self-hosting/self-hosting.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ For complete AI configuration details, see the [Environment Variables documentat
163163

164164
If you use a managed Redis service, you may need to set the `notify-keyspace-events` manually.
165165

166-
Without this setting we wont be able to listen for expired keys which we use for caluclating currently active vistors.
166+
Without this setting we won't be able to listen for expired keys which we use for calculating currently active visitors.
167167

168168
> You will see a warning in the logs if this needs to be set manually.
169169

self-hosting/docker-compose.template.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ services:
7373
- ./clickhouse/clickhouse-config.xml:/etc/clickhouse-server/config.d/op-config.xml:ro
7474
- ./clickhouse/clickhouse-user-config.xml:/etc/clickhouse-server/users.d/op-user-config.xml:ro
7575
- ./clickhouse/init-db.sh:/docker-entrypoint-initdb.d/init-db.sh:ro
76+
environment:
77+
- CLICKHOUSE_SKIP_USER_SETUP=1
7678
healthcheck:
7779
test: ["CMD-SHELL", 'clickhouse-client --query "SELECT 1"']
7880
interval: 10s
@@ -89,7 +91,7 @@ services:
8991
max-file: "3"
9092

9193
op-api:
92-
image: lindesvard/openpanel-api:latest
94+
image: lindesvard/openpanel-api:2.0.0
9395
restart: always
9496
command: >
9597
sh -c "
@@ -119,7 +121,7 @@ services:
119121
max-file: "3"
120122

121123
op-dashboard:
122-
image: lindesvard/openpanel-dashboard:latest
124+
image: lindesvard/openpanel-dashboard:2.0.0
123125
restart: always
124126
depends_on:
125127
op-api:
@@ -139,7 +141,7 @@ services:
139141
max-file: "3"
140142

141143
op-worker:
142-
image: lindesvard/openpanel-worker:latest
144+
image: lindesvard/openpanel-worker:2.0.0
143145
restart: always
144146
depends_on:
145147
op-api:

sh/docker-build

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,21 @@ docker buildx create --name multi-arch-builder --use || true
3838
build_image() {
3939
local app=$1
4040
local image_name="lindesvard/openpanel-$app"
41-
local full_version="$image_name:$VERSION"
41+
local full_version="$image_name:$VERSION-$PRERELEASE"
42+
43+
# Use apps/start/Dockerfile for dashboard app
44+
local dockerfile="apps/$app/Dockerfile"
45+
if [ "$app" = "dashboard" ]; then
46+
dockerfile="apps/start/Dockerfile"
47+
fi
4248

4349
if [ -n "$PRERELEASE" ]; then
4450
echo "(pre-release) Building multi-architecture image for $full_version"
4551
docker buildx build \
4652
--platform linux/amd64,linux/arm64 \
4753
-t "$full_version" \
4854
--build-arg DATABASE_URL="postgresql://p@p:5432/p" \
49-
-f "apps/$app/Dockerfile" \
55+
-f "$dockerfile" \
5056
--push \
5157
.
5258
else
@@ -56,7 +62,7 @@ build_image() {
5662
-t "$full_version" \
5763
-t "$image_name:latest" \
5864
--build-arg DATABASE_URL="postgresql://p@p:5432/p" \
59-
-f "apps/$app/Dockerfile" \
65+
-f "$dockerfile" \
6066
--push \
6167
.
6268
fi

0 commit comments

Comments
 (0)