Installation¶
AMP can be used as a hosted service or self-hosted. Choose the approach that fits your needs.
Hosted Service¶
The fastest way to get started. No infrastructure to manage.
- Create an account
- Get your API key from Settings → API Keys
- Start making API calls
export AMP_API_KEY="amp_live_xxxxxxxxxxxxxxxxxxxxx"
# Verify your connection
curl https://api.amp.dev/v1/auth/whoami \
-H "Authorization: Bearer $AMP_API_KEY"
CLI Installation¶
The AMP CLI provides a convenient interface for common operations.
After installation, authenticate:
Verify the installation:
Self-Hosted Installation¶
For teams requiring full control over their infrastructure.
Requirements¶
| Component | Minimum | Recommended |
|---|---|---|
| CPU | 2 cores | 4+ cores |
| Memory | 4 GB | 8+ GB |
| Storage | 20 GB | 50+ GB SSD |
| PostgreSQL | 12+ | 15+ |
| Redis | 6+ | 7+ |
| NATS | 2.9+ | 2.10+ |
Docker Compose (Recommended)¶
The fastest path to self-hosting:
# Clone the repository
git clone https://github.com/ubiship/amp.git
cd amp
# Copy environment template
cp .env.example .env
# Edit configuration (see Configuration section below)
nano .env
# Start all services
docker compose up -d
This starts:
- API Server — Port 8080
- Worker — Background job processing
- PostgreSQL — Primary database
- Redis — Caching layer
- NATS — Message queue
Verify services are running:
Manual Installation¶
For production deployments or custom setups.
1. Install Dependencies¶
# PostgreSQL
sudo apt install postgresql-15
# Redis
sudo apt install redis-server
# NATS
curl -L https://github.com/nats-io/nats-server/releases/download/v2.10.0/nats-server-v2.10.0-linux-amd64.tar.gz | tar xz
sudo mv nats-server-v2.10.0-linux-amd64/nats-server /usr/local/bin/
2. Build AMP¶
git clone https://github.com/ubiship/amp.git
cd amp
# Build binaries
make build
# Binaries are in ./bin/
ls bin/
# api worker
3. Configure Environment¶
Edit .env with your configuration:
# Server
PORT=8080
ENVIRONMENT=production
# Database
DATABASE_URL=postgres://user:pass@localhost:5432/amp?sslmode=require
# Cache & Queue
REDIS_URL=redis://localhost:6379
NATS_URL=nats://localhost:4222
# Authentication (Clerk)
CLERK_SECRET_KEY=sk_live_xxxxx
CLERK_PUBLISHABLE_KEY=pk_live_xxxxx
# AI Providers
ANTHROPIC_API_KEY=sk-ant-xxxxx
OPENAI_API_KEY=sk-xxxxx
# Publishing
METRICOOL_TOKEN=xxxxx
4. Initialize Database¶
5. Start Services¶
Configuration¶
Full configuration reference is available in the Self-Hosting Configuration guide.
Required Variables¶
| Variable | Description |
|---|---|
DATABASE_URL | PostgreSQL connection string |
REDIS_URL | Redis connection string |
NATS_URL | NATS server URL |
CLERK_SECRET_KEY | Clerk authentication secret |
ANTHROPIC_API_KEY | Claude API key (or alternative LLM) |
METRICOOL_TOKEN | Metricool publishing API token |
Optional Variables¶
| Variable | Default | Description |
|---|---|---|
PORT | 8080 | API server port |
ENVIRONMENT | development | Environment name |
LOG_LEVEL | info | Logging verbosity |
REQUEST_TIMEOUT | 30s | API request timeout |
WORKER_CONCURRENCY | 4 | Concurrent job workers |
Verify Installation¶
After installation, verify all components are working:
# Health check
curl http://localhost:8080/health
# {"status": "healthy"}
# Ready check (includes dependencies)
curl http://localhost:8080/ready
# {"status": "ready", "database": "ok", "redis": "ok", "nats": "ok"}
# Authenticate and test
curl http://localhost:8080/v1/auth/whoami \
-H "Authorization: Bearer $AMP_API_KEY"
Troubleshooting¶
Common Issues¶
Connection refused on port 8080
The API server isn't running or is on a different port.
Database connection failed
PostgreSQL isn't accessible or credentials are wrong.
NATS connection failed
NATS server isn't running or JetStream isn't enabled.
Next Steps¶
- Authentication — Set up API keys and access control
- Self-Hosting Guide — Production deployment
- CLI Reference — Command-line usage