suga dev) lets you build and test cloud applications entirely on your local machine without cloud access, accounts, or costs. This page explains how local development works, what’s emulated, and best practices for productive local workflows.
The Development Server
Thesuga dev command starts a local development server that:
- Emulates cloud resources - Buckets, entrypoints, databases, schedules
- Runs your services - Using the
dev.scriptfrom yoursuga.yaml - Hot reloads code - Automatically restarts services when files change
- Provides local URLs - Access your application at
localhostports
Start local development
Example output
What Gets Emulated
Services
Your application services run locally using theirdev.script:
suga.yaml
- Runs as a separate process
- Gets automatically restarted on code changes
- Receives environment variables from
suga.yaml - Can communicate with emulated resources
Buckets (Object Storage)
Buckets are emulated using the local filesystem:- Read/write/delete operations work like cloud storage
- Files persist between
suga devsessions - Pre-seed buckets by placing files in
.suga/buckets/{bucket-name}/ - View files directly in the file explorer
Works locally and in production
write()creates files in.suga/buckets/uploads/read()reads from.suga/buckets/uploads/delete()removes files from.suga/buckets/uploads/
Suga Client Libraries
Learn about generated client libraries for cloud-agnostic resource access
Entrypoints (HTTP Routing)
Entrypoints provide local HTTP servers with routing:suga.yaml
suga dev will result in:
- Path-based routing like production CDN
- Request/response logging
- CORS handling
Databases
PostgreSQL databases are automatically run locally:suga.yaml
- Automatic PostgreSQL instance created per database
- Connection strings injected into services via environment variables
- Data persists between
suga devsessions - Full PostgreSQL compatibility for development
suga dev, Suga:
- Starts a local PostgreSQL instance for each database using Docker
- Injects connection strings into services with access
- Makes databases available on local ports
Works locally and in production
The .suga Directory
Suga creates a .suga directory in your project for local state:
Development Workflow
Starting Development
Making Code Changes
- Edit your service code - Changes are detected automatically
- Service restarts - Using a watcher in your dev script
- Test immediately - New code is running
Debugging Services
Standard debugging tools work normally:- Node.js
- Python
- Go
package.json
localhost:9229.Viewing Logs
Service logs are written to.suga/logs/:
Seeding Local Data
Pre-populate buckets for testing:Read pre-seeded data
Environment Variables
Services receive environment variables defined insuga.yaml:
suga.yaml
suga dev:
- Service receives environment variables from
envconfig - Database connection strings automatically injected based on
env_var_key - Same variables are available in production (after Terraform deployment)
- Use for configuration, feature flags, etc.
Service Communication
Direct service-to-service communication is coming soon. For now, services can communicate through shared databases, buckets or entrypoint URLs.
Limitations
Local emulation provides high fidelity but has some limitations:Not Emulated
- Cloud-specific features - Lambda layers, CloudFront behaviors, CDN caching
- Scaling - Auto-scaling, load balancing across multiple instances
- Managed services - Cloud-specific features like S3 lifecycle policies
- Networking - VPCs, security groups, actual cloud networking
Performance Differences
- Cold starts - Service cold starts don’t occur locally
- Latency - No network latency between services
- Resource limits - Local resources not limited like a deployed service (memory, timeout)
Workarounds
For features that can’t be emulated:- Preview in cloud - Deploy to dev environment for testing
- Mock externals - Use mocks for cloud-specific APIs
- Integration tests - Test cloud features in CI/CD pipelines
Deployment Guide
Learn how to deploy to cloud environments for testing