> ## Documentation Index
> Fetch the complete documentation index at: https://www.jetify.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Running Services

> When working on an application, you often want some services or dependencies running in the background for testing. Take a web app as an example. While working on your application, you will want to test it against a running development server and database. Previously developers would manage these services via tools like Docker Compose or orchestrating them manually.

With Devbox, you can manage these services from the CLI using `devbox services`. Devbox uses
[process-compose](https://github.com/F1bonacc1/process-compose#-launcher) under the hood to start
and manage your project's services.

## Starting your Services[​](#starting-your-services "Direct link to Starting your Services")

You can start all the services in your project by running `devbox services up`. This will start
process-compose in the foreground, and start all the services associated with your project:

<img src="https://mintcdn.com/jetify/k7lJpyU9i-Y_obPW/docs/devbox/guides/services/process-compose-tui-interface.png?fit=max&auto=format&n=k7lJpyU9i-Y_obPW&q=85&s=f5a42b52daa70be4f1b7c62842bddf64" alt="Process Compose running in the foreground" width="1684" height="1208" data-path="docs/devbox/guides/services/process-compose-tui-interface.png" />

You can also start a specific service by passing the name as an argument. For example, to start just
`postgresql`, you can run `devbox services up postgresql`

If you want to restart your services (for example, after changing your configuration), you can run
`devbox services restart`

## Starting your Services in the Background[​](#starting-your-services-in-the-background "Direct link to Starting your Services in the Background")

If you want to start your services in the background, without launching the process-compose TUI, you
can use the `-b` flag. For example, to start all services in the background, you can run
`devbox services up -b`.

Services started in the background will continue running, even if the current shell is closed. To
stop your backgrounded services, run `devbox services stop`.

To see the current state of your running services, you can run `devbox services ls`.

You can also attach the process-compose TUI to your running background services by running
`devbox services attach`.

## Defining your Own Services[​](#defining-your-own-services "Direct link to Defining your Own Services")

If you have a process or service that you want to run with your Devbox project, you can define it
using a process-compose.yml in your project's root directory. For example, if you want to run a
Django server, you could add the following yaml:

```yaml theme={null}
# Process compose for starting django
version: "0.5"

processes:
  django:
    command: python todo_project/manage.py runserver
    availability:
      restart: "always"
```

This will now start your django service whenever you run `devbox services up`.

## Plugins that Support Services[​](#plugins-that-support-services "Direct link to Plugins that Support Services")

The following plugins provide a pre-configured service that can be managed with `devbox services`:

* [Apache](/docs/devbox/devbox-examples/servers/apache/) (apacheHttpd)
* [Caddy](/docs/devbox/devbox-examples/servers/caddy/) (caddy)
* [Nginx](/docs/devbox/devbox-examples/servers/nginx/) (nginx)
* [PostgreSQL](/docs/devbox/devbox-examples/databases/postgres/) (postgresql)
* [Redis](/docs/devbox/devbox-examples/databases/redis/) (redis)
* [Valkey](/docs/devbox/devbox-examples/databases/valkey/) (valkey)
* [PHP](/docs/devbox/devbox-examples/languages/php/) (php, php80, php81, php82)

The service will be made available to your project when you install the packages using `devbox add`.

## Listing the Services in our Project[​](#listing-the-services-in-our-project "Direct link to Listing the Services in our Project")

You can list all the services available to your current devbox project by running
`devbox services ls`. For example, the services in a PHP web app project might look like this:

```
devbox services ls

No services currently running. Run `devbox services up` to start them:

  django
  postgresql
```

If process-compose is already running, `devbox services ls` will show you the list of services
registered with process-compose and their current status

```text theme={null}
Services running in process-compose:
NAME              STATUS          EXIT CODE
django            Running         0
postgresql        Launched        0
```

## Stopping your services[​](#stopping-your-services "Direct link to Stopping your services")

You can stop your services with `devbox services stop`. This will stop process-compose, as well as
all the running services associated with your project.

If you want to stop a specific service, you can pass the name as an argument. For example, to stop
just `postgresql`, you can run `devbox services stop postgresql`

## Further Reading[​](#further-reading "Direct link to Further Reading")

* [**Devbox Services CLI Reference**](/docs/devbox/cli-reference/devbox-services/)
* [**Devbox Plugins**](/docs/devbox/guides/plugins/)

[Edit this page](https://github.com/jetify-com/docs/tree/main/docs/devbox/guides/services/index.mdx)
