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:

  1. Checks if any required ports are in use
  2. Stops the service on the required port
  3. 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:

  1. Find any process using port 3000
  2. Kill the process
  3. Free the port
  4. Show a confirmation message

Port Detection

runnem detects ports in two ways:

  1. From service URLs:
services:
  api:
    command: npm run dev
    url: http://localhost:3000  # Port 3000 detected
  1. From explicit port configuration:
services:
  api:
    command: npm run dev
    port: 3000  # Explicit port configuration

Best Practices

  1. Always define URLs or ports for your services
  2. Use different ports for different services
  3. Let runnem handle port conflicts automatically
  4. Use runnem kill only when necessary
  5. Check logs if services fail to start due to port issues

Troubleshooting Port Issues

If you encounter port-related issues:

  1. Check which process is using a port:
lsof -i :3000
  1. Use runnem to kill the process:
runnem kill 3000
  1. Verify the port is free:
runnem up
Previous
Dependency Management