Skip to main content
Use the Dev Server to evaluate authorization logic locally, without network calls to Oso Cloud.
First time? Install the CLI and editor tools before setting up the Dev Server.

Quickstart

Start the Dev Server using Docker:
Server runs at:http://localhost:8080.

Why use the Dev Server

  • Faster development cycles with instant policy updates and no network latency.
  • Offline development when internet connectivity is unreliable or unavailable.
  • Isolated testing of authorization changes before deploying to production.
  • CI/CD support for automated testing, no external dependencies.

Installation options

Choose the installation method that fits your development workflow.
Health check: The Oso Dev Server exposes a healthcheck endpoint that can be used for container orchestration and monitoring (for example, Kubernetes liveness and readiness probes). Endpoint: GET /api/healthcheck Example:
A successful response indicates that the Dev Server is running and able to serve requests.

Native binary

Download from the Oso Cloud dashboard. macOS/Linux:
Windows: Download and run the binary from the dashboard.

Environment configuration

Configure your application to use the local Dev Server instead of Oso Cloud. Set these environment variables:

SDK configuration

Configure your application’s Oso client to use the local server.
oso.js

Load your policy

Initialize the Dev Server with your authorization policy:

Advanced usage

Run alongside your app in local development:
Important: Use the service name (oso_service) as hostname when connecting from other containers.
Customize the Dev Server behavior with environment variables:
Data Management: The Dev Server stores data in .oso/ directory. Clear it between test runs:
Note: The on-disk file format is part of the API. Clear .oso/ directory when upgrading major versions.
Create isolated test environments for parallel integration tests:Create new environment:
Jest integration example:
Cleanup: Test environments persist on disk. Clear .oso/ directory periodically to free up resources.

Troubleshooting

Port already in use:
Permission error:
  • Ensure the binary has execute permissions: chmod +x oso-dev-server
  • Check that the .oso/ directory is writable
SDK can’t connect:
  • Check server is running: curl http://localhost:8080/api/healthcheck
  • Check environment variables: echo $OSO_URL $OSO_AUTH
  • Ensure you’re using the test token: e_0123456789_12345_osotesttoken01xiIn
Docker networking:
  • Use service names in Docker Compose, not localhost
  • Verify port mapping: -p 8080:8080
Policy not loading:
  • Check file path is correct and accessible
  • Use --watch-for-changes to reload automatically
  • Check logs for syntax errors

Important notes

Not for production use. The Dev Server is designed for development and testing only.
Version compatibility. Always validate policies against Oso Cloud before deploying.
Data persistence. Dev Server state is stored on disk. Clear .oso/ directory to reset.

Next steps