Self-hosting
The share-env relay is open source and can be self-hosted on any platform that runs Node.js 18+. Full control over TTL, rate limits, and infrastructure.
Four steps — runs in under 2 minutes.
$ git clone https://github.com/arjunn881/env-share.git
cd env-share$ npm install$ npm run build$ npm start --workspace=server
# To use a custom port:
PORT=8080 npm start --workspace=serverPass the --server flag to both push and pull:
# Sender $ npx share-env push --server https://your-relay.example.com # Receiver $ npx share-env pull <share-code> --server https://your-relay.example.com
These defaults are defined in server/src/index.ts and can be changed when self-hosting:
| Setting | Default | Description |
|---|---|---|
TTL_SECONDS | 600 (10 minutes) | Time before an uncollected payload is automatically deleted from memory |
RATE_LIMIT_MAX | 10 | Maximum requests per minute per IP address |
PORT | 3000 | Port the server listens on — overridden by the PORT environment variable |
// Adjust these values in your self-hosted relay const TTL_SECONDS = 600; // 10 minutes const RATE_LIMIT_MAX = 10; // requests per minute per IP const PORT = process.env.PORT || 3000;
Push the repo to GitHub, connect to Render, set build command to npm run build and start command to npm start --workspace=server.
render.com →Connect GitHub repo, Railway auto-detects Node.js. Set the start command and PORT environment variable.
railway.app →Use fly launch and fly deploy. The server runs as an always-on Fly Machine. Supports custom domains.
fly.io →SSH into your server, clone the repo, run npm install && npm run build, then use PM2 to keep the process alive.
env-share/ cli/ — The npm CLI package (share-env) src/ index.ts — CLI entry point and command definitions utils/ crypto.ts — AES-256-GCM encrypt/decrypt logic env.ts — Smart merge logic env-validator.ts — .env file format validation git.ts — .gitignore safety check server/ — The Express relay server src/ index.ts — Server entry point, routes, rate limiting
https://env-share-1rsi.onrender.com is provided free of charge on Render's free tier. It may experience cold-start latency (15–30s on first request after inactivity). Self-hosting avoids this.