Core Features
Port Management
runnem provides automatic port management to help you avoid conflicts when running multiple services. It can detect and resolve port conflicts automatically, and provides tools to manually manage ports when needed.
Automatic Port Management
When starting services, runnem automatically:
- Checks if any required ports are in use
- Stops the service on the required port
- Cleans up the port after stopping the service
Example of automatic port management in action:
$ runnem up
🔍 Checking ports...
⚠️ Port 3000 is in use by another process
🧹 Cleaned up port 3000 for frontend
🚀 Starting services...
Manual Port Management
You can manually manage ports using the kill
command:
runnem kill 3000
This will:
- Find any process using port 3000
- Kill the process
- Free the port
- Show a confirmation message
Port Detection
runnem detects ports in two ways:
- From service URLs:
services:
api:
command: npm run dev
url: http://localhost:3000 # Port 3000 detected
- From explicit port configuration:
services:
api:
command: npm run dev
port: 3000 # Explicit port configuration
Best Practices
- Always define URLs or ports for your services
- Use different ports for different services
- Let runnem handle port conflicts automatically
- Use
runnem kill
only when necessary - Check logs if services fail to start due to port issues
Troubleshooting Port Issues
If you encounter port-related issues:
- Check which process is using a port:
lsof -i :3000
- Use runnem to kill the process:
runnem kill 3000
- Verify the port is free:
runnem up