> ## 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.

# LEPP (Linux, Nginx, PHP, Postgres)

> An example Devbox shell for NGINX, Postgres, and PHP. This example uses Devbox Plugins for all 3 packages to simplify configuration.

[Example Repo](https://github.com/jetify-com/devbox/tree/main/examples/stacks/lepp-stack)

## How to Run[​](#how-to-run "Direct link to How to Run")

### Initializing[​](#initializing "Direct link to Initializing")

In this directory, run:

`devbox shell`

This will run `initdb` automatically on initialization. To start the Servers + Postgres service,
run:

`devbox services up`

### Creating the DB[​](#creating-the-db "Direct link to Creating the DB")

You can run the creation script using `devbox run create_db`. This will create a Postgres DB based
on `setup_postgres_db.sql`.

### Testing the Example[​](#testing-the-example "Direct link to Testing the Example")

You can query Nginx on port 80, which will route to the PHP example.

## How to Recreate this Example[​](#how-to-recreate-this-example "Direct link to How to Recreate this Example")

1. Create a new project with `devbox init`
2. Add the packages using the command below. Installing the packages with `devbox add` will ensure
   that the plugins are activated:

```bash theme={null}
devbox add postgresql@14 php@8.1 php81Extensions.pgsql@latest nginx@1.24
```

1. Update `devbox.d/nginx/httpd.conf` to point to the directory with your PHP files. You'll need to
   update the `root` directive to point to your project folder
2. Follow the instructions above in the How to Run section to initialize your project.

Note that the `.sock` filepath can only be maximum 100 characters long. You can point to a different
path by setting the `PGHOST` env variable in your `devbox.json` as follows:

```json theme={null}
"env": {
    "PGHOST": "/<some-shorter-path>"
}
```

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