Overview
Stormkit can run long-running server processes using the Start command setting. This is different from serverless functions and is ideal for:- Go HTTP servers
- Python web applications
- Node.js Express/Fastify apps
- Ruby on Rails applications
- Any application that runs a persistent process
How It Works
When you configure a start command:- Build command runs during deployment
- Build artifacts are packaged
- Start command launches your server process
- Server listens on the
PORTenvironment variable - Traffic is routed to your running server
Configuration
Basic Setup
1
Navigate to Config
Go to Your App > Environments > Config
2
Set Build Command
Configure how to build your application
3
Set Output Folder
Specify where build artifacts are located
4
Set Start Command
Enter the command to start your server
Required Settings
- Build command: Command to compile/build your application
- Output folder: Directory containing server executable and files
- Start command: Command to start the server process
Go Applications
Run Go HTTP servers by compiling a binary and starting it with the start command.Requirements
go.modfile in your build root- Go runtime version specified via
.go-versionormise.toml - Server must listen on
PORTenvironment variable
Runtime Version
Configuration Example
In Your App > Environments > Config:Server Code Example
cmd/server/main.go
With Gin Framework
cmd/server/main.go
Deployment Flow
1
Build Phase
go build -o .stormkit/server/app ./cmd/serverCompiles your Go code into a binary at .stormkit/server/app2
Upload Phase
The
.stormkit/server folder is packaged and uploaded as the server artifact3
Runtime Phase
Start command
./app executes the binaryServer listens on PORT and handles incoming requestsIncluding Assets
If your Go app needs templates, migrations, or other files:.stormkit/server are deployed with your binary.
Node.js Applications
Run Express, Fastify, or any Node.js HTTP server.Configuration Example
Server Code Example
server/index.js
With TypeScript
server/index.ts
Build Configuration
tsconfig.json
Python Applications
Run Flask, Django, or FastAPI applications.Requirements
requirements.txtorPipfile- Python version specified via
.python-versionormise.toml - Server must listen on
PORTenvironment variable
Runtime Version
Flask Example
app.py
Configuration
FastAPI Example
main.py
Configuration
Environment Variables
PORT Variable
Your server must listen on thePORT environment variable:
PORT at runtime. Using a hardcoded port will cause connection failures.
Custom Environment Variables
All environment variables configured in Config > Environment Variables are available to your server:Static Assets
Serve static files alongside your server application.Go Example with Static Files
Node.js Example with Static Files
Health Checks
Implement a health check endpoint for monitoring:Graceful Shutdown
Handle shutdown signals properly:Go Example
Node.js Example
Best Practices
Use Compiled Binaries (Go)
Include Dependencies
For Node.js, install production dependencies:Log to stdout/stderr
Use standard output for logs:Set Timeouts
Configure appropriate timeouts:Troubleshooting
Server Not Starting
If your server doesn’t start:- Check logs in deployment details
- Verify start command path is correct
- Ensure executable permissions (Go binaries)
- Check for missing dependencies
Connection Refused
If you can’t connect to your server:- Verify server listens on
PORTenvironment variable - Ensure server binds to
0.0.0.0, notlocalhost - Check firewall settings (self-hosted)
Build Failures
If build command fails:- Check build command syntax
- Verify runtime version is installed
- Ensure all dependencies are listed
- Review build logs for errors
Missing Files
If assets or dependencies are missing:- Verify output folder includes all required files
- Copy assets during build command
- Check that build artifacts are in correct location
Comparison: Start Command vs Serverless
Related Documentation
How We Deploy
Understand folder structure and deployment artifacts
Configuration
Configure build and deployment settings
System Variables
Available environment variables
Troubleshooting
Fix common deployment issues