Running more than one instance
To run more than one ShipLean instance, point every instance at the same application PostgreSQL database with SHIPLEAN_DB_CONNECTION. Point them all at the same Redis service, and use a shared attachment store such as PostgreSQL or S3. A local folder is not shared between instances unless you provide shared storage outside the app.
Add the Redis backplane
Section titled “Add the Redis backplane”Set SHIPLEAN_REDIS_CONNECTION on every ShipLean instance. SignalR uses Redis as its backplane, so an event published by one instance can reach clients connected to another. Redis also carries presence updates and member removals between instances.
Set channelPrefix in the StackExchange.Redis connection string. It defaults to shiplean. Use a distinct prefix for every deployment that shares one Redis server, so that their channels and keys stay separate.
services: shiplean: environment: SHIPLEAN_REDIS_CONNECTION: "redis:6379,channelPrefix=shiplean-prod" depends_on: - redis
redis: image: redis:7.4Add the environment setting and the Redis service to the Compose file you already use for ShipLean. Use a different prefix, such as shiplean-staging, for any other deployment that uses that Redis server. Make Redis reachable before the app starts. If Redis cannot be reached during startup, ShipLean fails to start and the container restarts.
Configure sticky sessions on your load balancer even when you use Redis. The SignalR negotiate request and the WebSocket connection must reach the same ShipLean instance.
Share attachment storage
Section titled “Share attachment storage”Every instance needs access to the same attachments and profile photos. Set SHIPLEAN_BLOB_DB_CONNECTION to use a shared PostgreSQL blob database, or set SHIPLEAN_BLOB_S3_CONNECTION to use a shared S3 bucket. The default local folder works for multiple instances only if the path is shared and mounted the same way on each one.
Changing the configured blob store does not move files that are already stored elsewhere. Plan a file migration before you switch a running deployment to a different store. See Storage options for provider examples and for the order in which ShipLean selects a store.
What Redis shares
Section titled “What Redis shares”With SHIPLEAN_REDIS_CONNECTION set, Redis handles these tasks:
- The SignalR backplane, which delivers live events across instances.
- Presence state and updates, shared across instances.
- Member-removal messages, which drop connected users who were removed from a project, on every instance.
Without Redis, the event bus, presence tracker, and member-removal handling run in each instance’s memory. Live events, presence, and removals therefore apply only to the instance that handled them. See the real-time events guide for the product’s full multi-instance behavior.