Docs: https://www.tinybird.co/docs/v2/get-started/install-tinybird/self-managed
- Tinybird account
- Domain name, and ability to update DNS recrods
- 4+ CPUs and 16+ GB virtual machine
- Docker
Sign up to https://cloud.tinybird.co and create your workspace.
Then Install Tinybird CLI, log in, and choose your workspace:
curl -fsSL https://api.tinybird.co/static/install.sh | sh
tb login
Create the DNS recrods for the tinybird.yourdomain.com
subdomain pointing to your VM.
Follow the instructions:
tb infra add
Copy all the TB_INFRA_
environment variables to use them later in your .env
file.
services:
tinybird:
image: tinybirdco/tinybird-local:beta
# If you want to limit container resources
# deploy:
# resources:
# limits:
# cpus: '4'
# memory: '16GB'
ports:
- "7181:7181"
env_file:
- .env
volumes:
- ./disk/var/lib/clickhouse:/var/lib/clickhouse
- ./disk/redis-data:/redis-data
nginx:
image: nginx:latest
ports:
- "80:80" # Redirect HTTP
- "443:443" # HTTPS
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./certs:/etc/nginx/certs:ro # SSL Certificates
depends_on:
- tinybird
Your .env
file, with the valeus coming from the tb infra add
step:
TB_INFRA_TOKEN=p.eyJpIjogIjg1ZjNk... # Keep it secret!
TB_INFRA_WORKSPACE=alejandromav
TB_INFRA_ORGANIZATION=Tinybird
[email protected]
Create a file nginx.conf
in your project folder with the following content:
events {}
http {
server {
listen 80;
server_name tinybird.yourdomain.com;
# Redirect all HTTP requests to HTTPS
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name tinybird.yourdomain.com;
# SSL Certificates
ssl_certificate /etc/nginx/certs/fullchain.pem;
ssl_certificate_key /etc/nginx/certs/privkey.pem;
# Reverse proxy to Tinybird
location / {
proxy_pass http://tinybird:7181; # Tinybird container
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
}
🔹 Replace tinybird.yourdomain.com
with your actual domain name.
You need an SSL certificate to enable HTTPS. You can use Let's Encrypt for free:
# Install Certbot
sudo apt install certbot
# Generate a certificate
# This will generate SSL files in /etc/letsencrypt/live/tinybird.yourdomain.com/
sudo certbot certonly --manual --preferred-challenges dns -d tinybird.yourdomain.com
# Copy the SSL files to your project:
mkdir -p certs
sudo cp /etc/letsencrypt/live/tinybird.yourdomain.com/fullchain.pem certs/
sudo cp /etc/letsencrypt/live/tinybird.yourdomain.com/privkey.pem certs/
docker-compose up -d
tb login --host https://tinybird.yourdomain.com