Skip to content

Commit bcabf39

Browse files
EvgastapEC2 Default User
andauthored
fix: supservisord environment vars + OSS documentation (#5361)
* fix: add supervisord env variables & update oss documentation * fix: create all required MinIO buckets in minio-setup --------- Co-authored-by: EC2 Default User <ec2-user@ip-172-31-46-114.ec2.internal>
1 parent af9f99b commit bcabf39

File tree

5 files changed

+296
-24
lines changed

5 files changed

+296
-24
lines changed

Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,16 @@ ENV CLICKHOUSE_HOST=http://localhost:8123
151151
ENV MINIO_ROOT_USER=minioadmin
152152
ENV MINIO_ROOT_PASSWORD=minioadmin
153153

154+
# Default environment variables for supervisord (can be overridden at runtime with -e)
155+
# These are read by supervisord.conf using %(ENV_VAR)s syntax
156+
ENV NEXT_PUBLIC_HELICONE_JAWN_SERVICE=http://localhost:8585
157+
ENV S3_ENDPOINT=http://localhost:9080
158+
ENV S3_ACCESS_KEY=minioadmin
159+
ENV S3_SECRET_KEY=minioadmin
160+
ENV S3_BUCKET_NAME=request-response-storage
161+
ENV S3_PROMPT_BUCKET_NAME=prompt-body-storage
162+
ENV BETTER_AUTH_SECRET=change-me-in-production
154163

155-
# Use supervisord as entrypoint
156164
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
157165

158166
# --------------------------------------------------------------------------------------------------------------------

docker/README.md

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,26 @@
1-
# Running locally
1+
# Docker Setup
2+
3+
## Quick Start: All-in-One Container
4+
5+
For the simplest self-hosted setup, use the all-in-one Docker image:
6+
7+
```bash
8+
docker pull helicone/helicone-all-in-one:latest
9+
docker run -d --name helicone -p 3000:3000 -p 8585:8585 -p 9080:9080 helicone/helicone-all-in-one:latest
10+
```
11+
12+
**Ports:**
13+
- `3000` - Web dashboard
14+
- `8585` - Jawn API + LLM proxy
15+
- `9080` - MinIO S3 storage (for request/response bodies)
16+
17+
For production deployments with custom domains, see the [official self-hosting docs](https://docs.helicone.ai/getting-started/self-host/docker).
18+
19+
---
20+
21+
# Local Development
22+
23+
## Running with Docker Compose
224

325
```
426
cp .env.example .env
@@ -8,12 +30,12 @@ docker compose up
830
NOTE: To create a user go to http://localhost:54323/project/default/auth/users and add your account.
931
You can use this account to sign into Helicone at localhost:3000 via your browser.
1032

11-
Default URLs:
33+
**Default URLs (Development):**
1234

1335
- Helicone Webpage: localhost:3000
14-
- Helicone OpenAI Proxy: localhost:8787
15-
- Helicone API: localhost:8788
16-
- Helicone GATEWAY: localhost:8790
36+
- Helicone Jawn API/Proxy: localhost:8585
37+
- OpenAI Proxy Worker: localhost:8787 (when running workers separately)
38+
- Helicone API Worker: localhost:8788 (when running workers separately)
1739

1840
# Maintenance
1941

docs/getting-started/self-host/cloud.mdx

Lines changed: 100 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,99 @@ description: "Set up Helicone on cloud infrastructure. Step-by-step instructions
99

1010
Create your node on the cloud. For example, on AWS, you can create an EC2 instance.
1111
Make sure that the instance has enough memory and disk space to run Helicone.
12-
For example, you can use the `m5.2xlarge` instance type on AWS.
12+
For example, you can use the `m5.xlarge` instance type on AWS.
1313

14-
Recommend Requirements
14+
Recommended Requirements
1515

16-
- 8 vCPUs
17-
- 32 GB RAM
18-
- 250 GB disk space
16+
- 4 vCPUs
17+
- 16 GB RAM
18+
- 100 GB disk space
19+
20+
## Option 1: All-in-One Image (Recommended)
21+
22+
The simplest approach uses the pre-built `helicone-all-in-one` Docker image.
23+
24+
### Within your remote machine
25+
26+
[Install Docker](https://docs.docker.com/engine/install/)
27+
28+
Run the container with your server's public IP:
29+
30+
```bash
31+
export PUBLIC_URL="http://YOUR_IP:3000"
32+
export JAWN_URL="http://YOUR_IP:8585"
33+
export S3_URL="http://YOUR_IP:9080"
34+
35+
docker run -d \
36+
--name helicone \
37+
-p 3000:3000 \
38+
-p 8585:8585 \
39+
-p 9080:9080 \
40+
-e SITE_URL="$PUBLIC_URL" \
41+
-e BETTER_AUTH_URL="$PUBLIC_URL" \
42+
-e BETTER_AUTH_SECRET="$(openssl rand -base64 32)" \
43+
-e NEXT_PUBLIC_APP_URL="$PUBLIC_URL" \
44+
-e NEXT_PUBLIC_HELICONE_JAWN_SERVICE="$JAWN_URL" \
45+
-e NEXT_PUBLIC_IS_ON_PREM=true \
46+
-e S3_ENDPOINT="$S3_URL" \
47+
helicone/helicone-all-in-one:latest
48+
```
49+
50+
See the [Docker guide](/getting-started/self-host/docker) for environment variables, user setup, and troubleshooting.
51+
52+
### Adding HTTPS through a reverse proxy (optional)
53+
54+
If you want to serve Helicone through a custom domain with HTTPS, you'll need a reverse proxy. Caddy is one option that provides automatic HTTPS with Let's Encrypt certificates. You can also use nginx, Traefik, or any other reverse proxy.
55+
56+
1. Point a domain to your server's IP (A record), e.g., `helicone-api.yourdomain.com`
57+
58+
2. Install Caddy:
59+
```bash
60+
curl -L "https://github.com/caddyserver/caddy/releases/latest/download/caddy_linux_amd64.tar.gz" -o caddy.tar.gz
61+
tar -xzf caddy.tar.gz caddy
62+
sudo mv caddy /usr/local/bin/
63+
sudo chmod +x /usr/local/bin/caddy
64+
```
65+
66+
3. Create `/etc/caddy/Caddyfile`:
67+
```caddyfile
68+
helicone-api.yourdomain.com {
69+
reverse_proxy localhost:8585
70+
}
71+
```
72+
73+
4. Run Caddy:
74+
```bash
75+
sudo mkdir -p /var/log/caddy /etc/caddy
76+
77+
sudo tee /etc/systemd/system/caddy.service > /dev/null <<'EOF'
78+
[Unit]
79+
Description=Caddy web server
80+
After=network.target
81+
82+
[Service]
83+
Type=notify
84+
User=root
85+
ExecStart=/usr/local/bin/caddy run --config /etc/caddy/Caddyfile
86+
ExecReload=/usr/local/bin/caddy reload --config /etc/caddy/Caddyfile
87+
AmbientCapabilities=CAP_NET_BIND_SERVICE
88+
89+
[Install]
90+
WantedBy=multi-user.target
91+
EOF
92+
93+
sudo systemctl daemon-reload
94+
sudo systemctl enable caddy
95+
sudo systemctl start caddy
96+
```
97+
98+
Now you can access the API via `https://helicone-api.yourdomain.com`.
99+
100+
---
101+
102+
## Option 2: Build from Source
103+
104+
For more control, you can build and run Helicone from source using Docker Compose.
19105

20106
### Within your remote machine
21107

@@ -35,7 +121,9 @@ cp .env.example .env
35121
./helicone-compose.sh helicone up
36122
```
37123

38-
### Assuming you have your ssh config setup like this...
124+
### Accessing via SSH tunnel
125+
126+
Assuming you have your ssh config setup like this:
39127

40128
```
41129
Host helicone
@@ -44,7 +132,7 @@ Host helicone
44132
IdentityFile ~/Desktop/secret.pem
45133
```
46134

47-
Let's test it by running this command on your localhost
135+
Test it by running this command on your localhost:
48136

49137
```bash
50138
ssh -N \
@@ -65,7 +153,7 @@ After you add a user, you can connect to the dashboard at http://localhost:3000/
65153

66154
The proxy is setup at localhost:8787 for OpenAI.
67155

68-
You can test it works by adding a new key on the http://localhost:3000 and then running this command on your localhost
156+
You can test it works by adding a new key on the http://localhost:3000 and then running this command on your localhost:
69157

70158
```bash
71159
# Test command
@@ -92,6 +180,10 @@ curl --request POST \
92180

93181
You should see all the data show up on Helicone.
94182

183+
---
184+
185+
## Production Checklist
186+
95187
The next steps before becoming production ready are:
96188

97189
1. Follow the instructions [here](https://supabase.com/docs/guides/self-hosting/docker#securing-the-dashboard) like

docs/getting-started/self-host/docker.mdx

Lines changed: 155 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,169 @@ description: "Deploy Helicone using Docker. Quick setup guide for running a cont
77

88
To run all services in a single Docker container, you can use the `helicone-all-in-one` image.
99

10+
## Quick Start (Local)
11+
1012
Get [Docker](https://docs.docker.com/get-docker/) and run the container:
13+
1114
```bash
12-
docker pull helicone/helicone-all-in-one:v2025.08.08
13-
docker run -d --name helicone-all-in-one -p 3000:3000 -p 8585:8585 -p 5432:5432 -p 8123:8123 -p 9000:9000 helicone/helicone-all-in-one:v2025.08.08
15+
docker pull helicone/helicone-all-in-one:latest
16+
docker run -d \
17+
--name helicone \
18+
-p 3000:3000 \
19+
-p 8585:8585 \
20+
-p 9080:9080 \
21+
helicone/helicone-all-in-one:latest
1422
```
1523

24+
Access the dashboard at `http://localhost:3000`.
25+
1626
## Example to test the Jawn service
27+
1728
```bash
18-
curl --location 'http://localhost:8585/v1/gateway/oai/v1/completions' \
29+
curl --location 'http://localhost:8585/v1/gateway/oai/v1/chat/completions' \
1930
--header "Content-Type: application/json" \
20-
--header "Authorization: Bearer {{OPENAI_API_KEY}}" \
21-
--header "Helicone-Auth: Bearer {{HELICONE_API_KEY}}" \
31+
--header "Authorization: Bearer $OPENAI_API_KEY" \
32+
--header "Helicone-Auth: Bearer $HELICONE_API_KEY" \
2233
--data '{
2334
"model": "gpt-4o-mini",
24-
"prompt": "Count to 5",
25-
"stream": false
35+
"messages": [{"role": "user", "content": "Hello"}]
2636
}'
2737
```
38+
39+
## Production Setup (Remote Server)
40+
41+
When deploying to a remote server (EC2, VPS, etc.), configure your server's public IP or domain:
42+
43+
```bash
44+
# Replace YOUR_IP with your server's public IP or domain
45+
export PUBLIC_URL="http://YOUR_IP:3000"
46+
export JAWN_URL="http://YOUR_IP:8585"
47+
export S3_URL="http://YOUR_IP:9080"
48+
49+
docker run -d \
50+
--name helicone \
51+
-p 3000:3000 \
52+
-p 8585:8585 \
53+
-p 9080:9080 \
54+
-e SITE_URL="$PUBLIC_URL" \
55+
-e BETTER_AUTH_URL="$PUBLIC_URL" \
56+
-e BETTER_AUTH_SECRET="$(openssl rand -base64 32)" \
57+
-e NEXT_PUBLIC_APP_URL="$PUBLIC_URL" \
58+
-e NEXT_PUBLIC_HELICONE_JAWN_SERVICE="$JAWN_URL" \
59+
-e NEXT_PUBLIC_IS_ON_PREM=true \
60+
-e S3_ENDPOINT="$S3_URL" \
61+
helicone/helicone-all-in-one:latest
62+
```
63+
64+
## Environment Variables
65+
66+
The container uses these environment variables (with defaults for local development):
67+
68+
| Variable | Default | Description |
69+
|----------|---------|-------------|
70+
| `NEXT_PUBLIC_HELICONE_JAWN_SERVICE` | `http://localhost:8585` | URL browsers use to reach the API. **Must be public URL for remote deployments.** |
71+
| `S3_ENDPOINT` | `http://localhost:9080` | URL browsers use for presigned URLs. **Must be public URL for remote deployments.** |
72+
| `S3_ACCESS_KEY` | `minioadmin` | MinIO access key |
73+
| `S3_SECRET_KEY` | `minioadmin` | MinIO secret key |
74+
| `S3_BUCKET_NAME` | `request-response-storage` | S3 bucket for request/response bodies |
75+
| `BETTER_AUTH_SECRET` | `change-me-in-production` | Auth secret. **Generate a secure value for production.** |
76+
| `SITE_URL` | - | Public URL of the web dashboard |
77+
| `BETTER_AUTH_URL` | - | Same as SITE_URL |
78+
| `NEXT_PUBLIC_APP_URL` | - | Same as SITE_URL |
79+
| `NEXT_PUBLIC_IS_ON_PREM` | - | Set to `true` for non-localhost deployments |
80+
81+
## Port Requirements
82+
83+
| Port | Service | Required For |
84+
|------|---------|--------------|
85+
| 3000 | Web Dashboard | Browser access |
86+
| 8585 | Jawn API + LLM Proxy | Browser API calls, LLM proxying |
87+
| 9080 | MinIO S3 | Request/response body storage |
88+
| 5432 | PostgreSQL | Internal (can be restricted) |
89+
| 8123 | ClickHouse | Internal (can be restricted) |
90+
91+
**Important:** Ports 3000, 8585, and 9080 must be accessible from browsers accessing the dashboard.
92+
93+
## User Account Setup
94+
95+
### Create Account
96+
97+
Navigate to `http://YOUR_IP:3000/signup` and create your account.
98+
99+
### Email Verification
100+
101+
The container doesn't include email services. Manually verify users:
102+
103+
```bash
104+
docker exec -u postgres helicone psql -d helicone_test -c \
105+
"UPDATE \"user\" SET \"emailVerified\" = true WHERE email = 'your@email.com';"
106+
```
107+
108+
### Organization Setup
109+
110+
Users need an organization. If you see "No organization ID found" errors:
111+
112+
```bash
113+
# Get your user ID
114+
docker exec -u postgres helicone psql -d helicone_test -c \
115+
"SELECT id, email FROM \"user\" WHERE email = 'your@email.com';"
116+
117+
# Create organization (save the returned ID)
118+
docker exec -u postgres helicone psql -d helicone_test -c \
119+
"INSERT INTO organization (name, is_personal) VALUES ('My Org', true) RETURNING id;"
120+
121+
# Add user to organization (replace USER_ID and ORG_ID)
122+
docker exec -u postgres helicone psql -d helicone_test -c \
123+
"INSERT INTO organization_member (\"user\", organization, org_role) \
124+
VALUES ('USER_ID', 'ORG_ID', 'admin');"
125+
```
126+
127+
## Supported LLM Providers
128+
129+
- OpenAI: `http://YOUR_IP:8585/v1/gateway/oai/v1/chat/completions`
130+
- Anthropic: `http://YOUR_IP:8585/v1/gateway/anthropic/v1/messages`
131+
132+
Other providers (Vertex AI, AWS Bedrock, Azure OpenAI) are not supported in the self-hosted version.
133+
134+
## Important Notes
135+
136+
### Data Persistence
137+
138+
Container restarts will wipe all data. For production, mount Docker volumes:
139+
140+
```bash
141+
-v helicone-postgres:/var/lib/postgresql/data \
142+
-v helicone-clickhouse:/var/lib/clickhouse \
143+
-v helicone-minio:/data
144+
```
145+
146+
### Security
147+
148+
Port 8585 does not require authentication for proxying requests. Anyone with access can proxy LLM requests through your endpoint. Restrict access via firewall rules.
149+
150+
### HTTPS
151+
152+
For HTTPS support, use a reverse proxy (Caddy, nginx, Traefik) in front of the container. See the [Cloud Deployment guide](/getting-started/self-host/cloud) for a Caddy example.
153+
154+
## Troubleshooting
155+
156+
### API calls fail with connection refused
157+
158+
The web app tries to connect to `localhost:8585` instead of your public IP. Verify the environment variable was set:
159+
160+
```bash
161+
curl http://YOUR_IP:3000/__ENV.js | grep JAWN
162+
# Should show your public IP, not localhost
163+
```
164+
165+
### Infinite redirect loop
166+
167+
Missing `NEXT_PUBLIC_IS_ON_PREM=true` environment variable.
168+
169+
### "Invalid origin" error on sign-in
170+
171+
All URL environment variables must use the same origin (public IP or domain). Don't mix `localhost` with public IPs.
172+
173+
### "No organization ID found" error
174+
175+
User needs to be added to an organization. See the Organization Setup section above.

0 commit comments

Comments
 (0)