---
id: "install-and-run"
type: "guide"
title: "Install and run a service"
summary: "Install the servix CLI, install a service by package name or path, and drive it through its lifecycle."
why: "One consistent lifecycle surface (install/start/pause/resume/stop/status/logs) works for every wrapped service."
audiences: ["developers"]
prerequisites: ["service-discovery"]
related: ["wrap-a-function", "wrap-a-listener"]
---
# Install and run a service

1. Install the CLI globally:

```bash
npm install -g @x12i/servix
```

2. Install the service — by npm package name (uses the `servix.entry` contract) or direct path:

```bash
servix install @x12i/my-service
# or during development:
servix install ./dist/servix.service.js
```

3. Configure if needed, then drive the lifecycle:

```bash
servix config set my-service port=4301
servix start my-service
servix status my-service
servix health my-service
servix logs my-service --follow
servix pause my-service
servix resume my-service
servix stop my-service
```

Service state lives under `~/.servix/services/<name>/` (manifest, config, state, pid, logs, control socket).