State Manager Setup Guide
This guide provides step-by-step instructions for setting up the Exosphere state manager in both local and production environments.
Overview
The Exosphere state manager is the core backend service that handles workflow execution, state management, and coordination between nodes. It provides a REST API for managing graph templates, registered nodes, and workflow execution states.
Local Setup
The easiest way to run the state manager locally is using Docker. This approach ensures consistent environments and minimal setup.
Prerequisites
- Docker installed
Setup Steps
-
Pull the public image and run:
docker run -d \ --name exosphere-state-manager \ -p 8000:8000 \ -e MONGO_URI="your-mongodb-connection-string" \ -e MONGO_DATABASE_NAME="your-database-name" \ -e STATE_MANAGER_SECRET="your-secret-key" \ -e SECRETS_ENCRYPTION_KEY="your-base64-encoded-encryption-key" \ ghcr.io/exospherehost/state-manager:latest
-
Verify the service is running:
The state manager will be available at http://localhost:8000
Required Environment Variables
Variable | Description | Required |
---|---|---|
MONGO_URI |
MongoDB connection string | Yes |
MONGO_DATABASE_NAME |
Database name | Yes |
STATE_MANAGER_SECRET |
Secret API key for authentication | Yes |
SECRETS_ENCRYPTION_KEY |
Base64-encoded key for data encryption | Yes |
For development or when you need more control over the environment, you can run the state manager locally using the source code.
Prerequisites
- Python 3.12 or higher
- uv package manager
- Git
Setup Steps
-
Clone the repository:
-
Install dependencies:
-
Set up environment variables:
-
Run the state manager:
The state manager will be available at http://localhost:8000
The state manager uri and key would be configured accordingly while setting up nodes and graphs as per the config given locally.
Production Setup
For production workloads, we recommend using the hosted Exosphere platform. This provides managed infrastructure with high availability, automatic scaling, and enterprise-grade security.
Getting Started
- Get your credentials from the Exosphere dashboard:
- State manager URL
- API key for authentication
-
Namespace configuration
-
Contact us for setup assistance:
-
Email: nivedit@exosphere.host
-
Configure your application:
For organizations that need complete control over their infrastructure, you can deploy the state manager on your own infrastructure.
Prerequisites
- Kubernetes cluster (recommended) or Docker Swarm
- MongoDB cluster (Atlas, DocumentDB, or self-hosted)
- Load balancer and ingress controller
- SSL certificates for HTTPS
Docker Deployment
-
Create a Docker Compose file for production:
version: '3.8' services: state-manager: image: ghcr.io/exospherehost/exosphere-state-manager:latest ports: - "8000:8000" environment: - MONGO_URI=${MONGO_URI} - MONGO_DATABASE_NAME=${MONGO_DATABASE_NAME} - STATE_MANAGER_SECRET=${STATE_MANAGER_SECRET} - SECRETS_ENCRYPTION_KEY=${SECRETS_ENCRYPTION_KEY} deploy: replicas: 3 update_config: parallelism: 1 delay: 10s restart_policy: condition: on-failure
-
Deploy to your infrastructure:
Kubernetes Deployment
-
Create namespace:
-
Create ConfigMap for configuration:
-
Create Secret for sensitive data:
-
Deploy the state manager:
Configuration Reference
Environment Variables
Variable | Description | Required | Default |
---|---|---|---|
MONGO_URI |
MongoDB connection string | Yes | - |
MONGO_DATABASE_NAME |
Database name | Yes | exosphere |
STATE_MANAGER_SECRET |
Secret API key for authentication | Yes | - |
SECRETS_ENCRYPTION_KEY |
Base64-encoded key for data encryption | Yes | - |
LOG_LEVEL |
Logging level (DEBUG, INFO, WARNING, ERROR) | No | INFO |
Monitoring and Health Checks
Health Check Endpoint
The state manager provides a health check endpoint:
Response: 200
Getting Help
- Documentation: docs.exosphere.host
- GitHub Issues: github.com/exospherehost/exospherehost/issues
- Discord Community: discord.gg/exosphere
- Email Support: support@exosphere.host
Next Steps
- Dashboard Setup - Set up the web dashboard for monitoring
- Node Development - Learn how to create and register nodes
- Graph Creation - Build workflows using graph templates