# Prepare your installation

Extract the release, create the database, install dependencies and create the private configuration.

1. Extract the release package from your CZ App Studio purchase into a private working directory.
2. Extract the Core download into a folder for the application, for example `backend/`. The guides call this folder `backend/`; run application commands from it. Add-ons are installed later from **Settings → Modules**.
3. Create a dedicated database and a user restricted to that database.
4. Point an application hostname, such as `hr.example.com`, to the application server.
5. Configure HTTPS and set the web document root to the full path of `backend/public`.
6. Arrange SMTP delivery, scheduled tasks and worker services.

Do not expose the repository root, `.env`, source, backups or private uploads through the public document root.

## Install dependencies

```bash
cd backend
composer install --no-dev --prefer-dist --optimize-autoloader
composer check-platform-reqs --no-dev
npm ci
npm run build
npx playwright install --with-deps chromium
```

Use the supplied lockfiles. Node.js and Chromium are also required on the application server for letters, payslips and PDF exports. Run the browser installation for the account that runs PHP and queue workers, or set `PDF_CHROMIUM_BINARY` to an installed Chromium executable. Set `PDF_NODE_BINARY` if Node is not on the service account's PATH. Install fonts for the languages you enable; the Docker image includes Noto fonts. Keep Chromium sandboxing enabled and run application services as a non-root user. Do not deploy a development `public/hot` file. Composer dependencies must match the server's PHP platform.

## Create private configuration

On a new installation only:

```bash
cp .env.example .env
php artisan key:generate
php artisan jwt:secret
```

Continue with [configuration](https://czappstudio.com/docs/installation/configuration). Do not overwrite an existing `.env` or regenerate encryption/authentication keys during updates.
