Skip to content

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.

  1. Create an account
  2. Get your API key from Settings → API Keys
  3. 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.

npm install -g @ubiship/amp
yarn global add @ubiship/amp
pnpm add -g @ubiship/amp

After installation, authenticate:

amp auth login

Verify the installation:

amp --version
amp whoami

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+

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:

docker compose ps

# Check API health
curl http://localhost:8080/health

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

cp .env.example .env

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

# Run migrations
make db-migrate

# Or manually
./bin/api migrate up

5. Start Services

# Start API server
./bin/api serve

# Start worker (separate terminal)
./bin/worker

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.

# Check if process is running
ps aux | grep amp

# Check Docker containers
docker compose ps

# View logs
docker compose logs api
Database connection failed

PostgreSQL isn't accessible or credentials are wrong.

# Test connection directly
psql $DATABASE_URL -c "SELECT 1"

# Check PostgreSQL is running
sudo systemctl status postgresql
NATS connection failed

NATS server isn't running or JetStream isn't enabled.

# Check NATS status
nats server info

# Ensure JetStream is enabled
nats stream ls

Next Steps