Skip to main content
AgentDoor can be deployed to multiple platforms depending on your application requirements. Each platform offers different tradeoffs for storage, performance, and scalability.

Deployment Platforms

AgentDoor provides official templates for three major platforms:

Railway

Full Node.js runtime with Docker support and built-in PostgreSQL

Cloudflare Workers

Edge computing with global distribution and near-zero cold starts

Vercel

Serverless Next.js deployment with automatic scaling

Platform Comparison

FeatureRailwayCloudflare WorkersVercel
RuntimeNode.js (Docker)V8 IsolatesNode.js (Serverless)
Cold Starts~1-2s<10ms~200-500ms
Execution TimeUnlimited30s (free), 15m (paid)10s (hobby), 60s (pro)
StoragePostgreSQL, SQLiteKV, D1, Durable ObjectsExternal (PostgreSQL, etc.)
Best ForTraditional apps, databasesHigh-traffic APIs, global appsNext.js apps, Jamstack
Pricing$5/month + usageFree tier generousFree tier available

Storage Options

AgentDoor requires persistent storage to manage agent registrations, API keys, and authentication state. Choose a storage backend based on your platform:

Memory Store (Development Only)

import { MemoryStore } from '@agentdoor/core/storage/memory';

const store = new MemoryStore();
Memory store loses all data on restart. Never use in production.

SQLite (Railway, Local)

import { SQLiteStore } from '@agentdoor/core/advanced/storage';

const store = new SQLiteStore({
  path: './data/agentdoor.db'
});
Best for single-instance deployments on Railway with persistent volumes.

PostgreSQL (Railway, External)

import { PostgresStore } from '@agentdoor/core/storage/postgres';

const store = new PostgresStore({
  connectionString: process.env.DATABASE_URL
});
Best for production deployments requiring high availability and scalability.

Cloudflare D1 (Cloudflare Workers)

import { D1Store } from '@agentdoor/cloudflare';

const store = new D1Store({
  database: env.DB // Cloudflare D1 binding
});
Serverless SQLite for Cloudflare Workers with automatic replication.

Environment Variables

All deployment platforms require these core environment variables:
VariableDescriptionRequired
X402_WALLETYour wallet address for receiving x402 micropayments (USDC on Base)Yes
DATABASE_URLPostgreSQL connection string (if using PostgreSQL)Conditional
PORTServer port (auto-set by most platforms)No

Security Considerations

API Keys and Secrets

Agent API keys are hashed using SHA-256 before storage. Never store plaintext API keys.
import { createHash } from 'crypto';

const apiKeyHash = createHash('sha256')
  .update(apiKey)
  .digest('hex');

Environment Variable Management

Set variables in Railway dashboard under Variables tab or via railway.json:
{
  "deploy": {
    "environmentVariables": {
      "X402_WALLET": "${X402_WALLET}"
    }
  }
}

Edge vs Serverless vs Traditional

Edge Computing (Cloudflare Workers)

Pros:
  • Globally distributed (300+ locations)
  • Near-zero cold starts (<10ms)
  • Pay-per-request pricing
  • Built-in DDoS protection
Cons:
  • Limited execution time (30s-15m)
  • No native file system access
  • Requires edge-compatible storage (D1, KV)
Use When:
  • You need global low-latency access
  • High traffic with unpredictable spikes
  • Cost optimization for sporadic usage

Serverless (Vercel)

Pros:
  • Automatic scaling
  • Zero infrastructure management
  • Excellent Next.js integration
  • Free tier available
Cons:
  • Cold starts (~200-500ms)
  • Limited execution time (10-60s)
  • Requires external database
Use When:
  • Building a Next.js application
  • Need automatic scaling
  • Want minimal DevOps overhead

Traditional (Railway)

Pros:
  • Full Node.js runtime
  • Unlimited execution time
  • Built-in PostgreSQL
  • WebSocket support
Cons:
  • Manual scaling required
  • Higher baseline cost
  • Slower cold starts
Use When:
  • Need long-running processes
  • Require WebSocket connections
  • Want traditional database access

Monitoring and Observability

Request Logging

AgentDoor automatically tracks agent requests and authentication attempts. Access logs via your platform’s logging system:
import { agentDoor } from '@agentdoor/express';

app.use('/api', agentDoor({
  // ... config
  onRequest: (agent, request) => {
    console.log(`Agent ${agent.id} requested ${request.url}`);
  }
}));

Health Checks

Implement health check endpoints for monitoring:
app.get('/health', (req, res) => {
  res.json({
    status: 'healthy',
    uptime: process.uptime(),
    timestamp: new Date().toISOString()
  });
});

Next Steps

Choose your deployment platform:

Deploy to Railway

Traditional Node.js deployment with PostgreSQL

Deploy to Cloudflare

Edge computing with global distribution

Deploy to Vercel

Serverless Next.js deployment

Build docs developers (and LLMs) love