System Requirements
Sentry is a resource-intensive application that runs multiple services including PostgreSQL, Redis, Kafka, ClickHouse, and various Python workers.
| Component | Minimum | Recommended |
|---|---|---|
| CPU | 4 vCPUs | 8+ vCPUs |
| RAM | 8 GB | 16+ GB |
| Storage | 40 GB SSD | 100+ GB NVMe SSD |
| OS | Ubuntu 22.04/24.04 LTS | Ubuntu 24.04 LTS |
| Network | 1 Gbps | 1 Gbps with dedicated IP |
Recommended RamNode Plan
For production deployments, we recommend starting with the Premium SSD 8GB plan or higher. For development and testing, the Premium SSD 4GB plan can work but may experience slower performance during high-load periods.
VPS Setup
Deploy Your RamNode VPS
- Log in to your RamNode control panel
- Select Deploy New Server and choose your preferred location
- Select Ubuntu 24.04 LTS as your operating system
- Choose a plan with at least 8GB RAM for production use
- Add your SSH key for secure access
- Deploy and note your server's IP address
Initial Server Configuration
# Connect to your server
ssh root@YOUR_SERVER_IP
# Update system packages
apt update && apt upgrade -y
# Set timezone
timedatectl set-timezone UTC
# Configure hostname
hostnamectl set-hostname sentry
# Install essential packages
apt install -y curl wget git vim ufw fail2ban htopConfigure Firewall
# Enable UFW
ufw default deny incoming
ufw default allow outgoing
# Allow SSH
ufw allow 22/tcp
# Allow HTTP and HTTPS
ufw allow 80/tcp
ufw allow 443/tcp
# Enable firewall
ufw enable
# Verify status
ufw status verboseCreate Sentry User
# Create sentry user
adduser --disabled-password --gecos "" sentry
# Add to docker group (after Docker installation)
usermod -aG docker sentry
# Switch to sentry user for remaining setup
su - sentryDocker Installation
# Remove old versions
sudo apt remove docker docker-engine docker.io containerd runc 2>/dev/null
# Install prerequisites
sudo apt install -y ca-certificates curl gnupg lsb-release
# Add Docker's official GPG key
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
| sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
# Add Docker repository
echo "deb [arch=$(dpkg --print-architecture) \
signed-by=/etc/apt/keyrings/docker.gpg] \
https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Install Docker
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io \
docker-buildx-plugin docker-compose-plugin
# Verify installation
docker --version
docker compose versionConfigure Docker
# Create Docker daemon configuration
sudo tee /etc/docker/daemon.json > /dev/null <<EOF
{
"log-driver": "json-file",
"log-opts": {
"max-size": "100m",
"max-file": "3"
},
"storage-driver": "overlay2"
}
EOF
# Restart Docker to apply changes
sudo systemctl restart docker
# Enable Docker to start on boot
sudo systemctl enable dockerSentry Installation
Clone the Repository
# Switch to sentry user if not already
su - sentry
# Clone the repository
git clone https://github.com/getsentry/self-hosted.git sentry
cd sentry
# Checkout the latest stable release
git fetch --tags
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout $LATEST_TAG
echo "Installing Sentry version: $LATEST_TAG"Configure Environment
# Copy environment template
cp .env.example .env
# Edit environment file
vim .env# Primary configuration
SENTRY_BIND=9000
SENTRY_SECRET_KEY= # Will be generated automatically
# Mail configuration (example with SMTP)
SENTRY_MAIL_HOST=smtp.your-provider.com
SENTRY_MAIL_PORT=587
SENTRY_MAIL_USERNAME=your-email@domain.com
SENTRY_MAIL_PASSWORD=your-app-password
SENTRY_MAIL_USE_TLS=true
SENTRY_SERVER_EMAIL=sentry@yourdomain.com
# Data retention (in days)
SENTRY_EVENT_RETENTION_DAYS=90Configure Sentry Settings
system.url-prefix: 'https://sentry.yourdomain.com'
system.admin-email: 'admin@yourdomain.com'
# Enable features
features.organizations:discover-basic: true
features.organizations:discover-query: true
features.organizations:performance-view: trueRun the Installer
# Run the installer
./install.shDuring installation, you'll be prompted to create an admin user. Use a strong password and remember these credentials.
Start Sentry
# Start Sentry in detached mode
docker compose up -d
# Verify all containers are running
docker compose ps
# View logs (optional)
docker compose logs -fNginx Reverse Proxy
# Exit sentry user to root
exit
# Install Nginx
apt install -y nginx
# Start and enable Nginx
systemctl start nginx
systemctl enable nginxConfigure Virtual Host
server {
listen 80;
server_name sentry.yourdomain.com;
location / {
proxy_pass http://127.0.0.1:9000;
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;
# WebSocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# Timeouts
proxy_connect_timeout 300;
proxy_send_timeout 300;
proxy_read_timeout 300;
# File upload size
client_max_body_size 100M;
}
}# Enable the site
ln -sf /etc/nginx/sites-available/sentry /etc/nginx/sites-enabled/
rm -f /etc/nginx/sites-enabled/default
# Test and reload
nginx -t && systemctl reload nginx
# Install Certbot
apt install -y certbot python3-certbot-nginx
# Obtain SSL certificate
certbot --nginx -d sentry.yourdomain.com \
--non-interactive --agree-tos \
--email admin@yourdomain.com
# Verify auto-renewal
certbot renew --dry-runEmail Configuration
# Email configuration
mail.backend = 'smtp'
mail.host = 'smtp.your-provider.com'
mail.port = 587
mail.username = 'your-email@domain.com'
mail.password = 'your-app-password'
mail.use-tls = True
mail.use-ssl = False
mail.from = 'sentry@yourdomain.com'
mail.list-namespace = 'sentry.yourdomain.com'Performance Tuning
services:
web:
deploy:
resources:
limits:
memory: 2G
reservations:
memory: 1G
worker:
deploy:
resources:
limits:
memory: 2G
reservations:
memory: 1G
postgres:
command: postgres -c max_connections=200
deploy:
resources:
limits:
memory: 2G
redis:
deploy:
resources:
limits:
memory: 512M# Restart with new configuration
docker compose down
docker compose up -dSDK Integration
Integrate Sentry into your applications using the official SDKs:
JavaScript/Node.js
npm install @sentry/node
// Initialize in your app
const Sentry = require("@sentry/node");
Sentry.init({
dsn: "https://YOUR_KEY@sentry.yourdomain.com/PROJECT_ID",
environment: "production",
tracesSampleRate: 1.0,
});Python
pip install sentry-sdk
# Initialize in your app
import sentry_sdk
sentry_sdk.init(
dsn="https://YOUR_KEY@sentry.yourdomain.com/PROJECT_ID",
environment="production",
traces_sample_rate=1.0,
)PHP
composer require sentry/sentry
// Initialize in your app
\Sentry\init([
'dsn' => 'https://YOUR_KEY@sentry.yourdomain.com/PROJECT_ID',
'environment' => 'production',
'traces_sample_rate' => 1.0,
]);Backup & Maintenance
Database Backup Script
#!/bin/bash
# /home/sentry/backup-sentry.sh
set -e
BACKUP_DIR="/home/sentry/backups"
DATE=$(date +%Y%m%d_%H%M%S)
mkdir -p $BACKUP_DIR
cd /home/sentry/sentry
# Backup PostgreSQL
docker compose exec -T postgres pg_dump -U postgres sentry | \
gzip > $BACKUP_DIR/sentry_postgres_$DATE.sql.gz
# Backup volumes
tar -czf $BACKUP_DIR/sentry_volumes_$DATE.tar.gz \
-C /var/lib/docker/volumes .
# Keep only last 7 days of backups
find $BACKUP_DIR -name "sentry_*" -mtime +7 -delete
echo "Backup completed: $DATE"chmod +x /home/sentry/backup-sentry.sh
# Add to crontab (daily at 3 AM)
(crontab -l 2>/dev/null; echo "0 3 * * * /home/sentry/backup-sentry.sh") | crontab -Updating Sentry
# Navigate to Sentry directory
cd /home/sentry/sentry
# Pull latest changes
git fetch --tags
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
# Check current version
CURRENT_TAG=$(git describe --tags)
echo "Current: $CURRENT_TAG, Latest: $LATEST_TAG"
# Update if new version available
if [ "$CURRENT_TAG" != "$LATEST_TAG" ]; then
# Stop services
docker compose down
# Checkout new version
git checkout $LATEST_TAG
# Run installer (handles migrations)
./install.sh --skip-user-creation
# Start services
docker compose up -d
fiCleanup Commands
# Clean up old events (run periodically)
cd /home/sentry/sentry
docker compose exec web sentry cleanup --days=90
# Remove unused Docker resources
docker system prune -af --volumes
# Check disk usage
df -h
du -sh /var/lib/docker/volumes/*Troubleshooting
Useful Commands
| Command | Purpose |
|---|---|
| docker compose ps | List all container statuses |
| docker compose logs -f service | Follow logs for a service |
| docker compose restart service | Restart a specific service |
| docker compose down && up -d | Full restart all services |
| docker compose exec web sentry shell | Access Sentry shell |
Sentry Deployed Successfully!
You now have a fully functional, self-hosted Sentry installation with enterprise-grade error tracking and performance monitoring.
Next steps: Integrate Sentry SDKs into your applications, configure alert rules for critical errors, set up team members with appropriate permissions, and consider enabling session replay and profiling.
