First time? Install the CLI and editor tools before setting up the Dev Server.
Quickstart
Start the Dev Server using Docker: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.Docker (Recommended)
Native binary
Download from the Oso Cloud dashboard. macOS/Linux: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.- Node.js
- Python
- Go
oso.js
Load your policy
Initialize the Dev Server with your authorization policy:Advanced usage
Docker Compose integration
Docker Compose integration
Run alongside your app in local development:Important: Use the service name (
oso_service) as hostname when connecting from other containers.Configuration options
Configuration options
Customize the Dev Server behavior with environment variables:Data Management:
The Dev Server stores data in
.oso/ directory. Clear it between test runs:Pin Dev Server versions in CI
Pin Dev Server versions in CI
.oso/ directory when upgrading major versions.Parallel test environments
Parallel test environments
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
Dev Server won't start
Dev Server won't start
Port already in use:Permission error:
- Ensure the binary has execute permissions:
chmod +x oso-dev-server - Check that the
.oso/directory is writable
Connection issues
Connection issues
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
- Use service names in Docker Compose, not
localhost - Verify port mapping:
-p 8080:8080
Policy issues
Policy issues
Policy not loading:
- Check file path is correct and accessible
- Use
--watch-for-changesto reload automatically - Check logs for syntax errors
Important notes
Next steps
- Write authorization policies using Polar
- Model your data as facts for authorization decisions
- Implement authorization checks in your application