# Install on a Linux VPS

Install Open Core HR on a Linux server with Nginx, PHP-FPM, MySQL and a process manager.

Use a maintained Linux distribution. Install Nginx, compatible PHP-FPM/CLI and extensions, MySQL, Composer and a process manager using supported packages. Package names and socket paths vary by distribution.

1. Create a deployment account and dedicated database/user.
2. Put the application in `/srv/open-core-hr/backend` or your chosen private path.
3. Follow [preparation](https://czappstudio.com/ar/docs/installation/prepare) and [configuration](https://czappstudio.com/ar/docs/installation/configuration).
4. Give PHP-FPM write access to `storage` and `bootstrap/cache`. Keep source and secrets private; do not use world-writable permissions.
5. Configure Nginx, replacing the hostname, path and socket below:

```nginx
server {
    listen 80;
    server_name hr.example.com;
    root /srv/open-core-hr/backend/public;
    index index.php;
    client_max_body_size 20m;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }
    location ~ ^/index\.php(/|$) {
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        fastcgi_pass unix:/run/php/php8.5-fpm.sock;
        fastcgi_hide_header X-Powered-By;
    }
    location ~ \.php$ { return 404; }
    location ~ /\.(?!well-known).* { deny all; }
}
```

6. Test the Nginx configuration and reload it.
7. Issue an HTTPS certificate and configure HTTP-to-HTTPS redirection.
8. Set up [cron and supervised services](https://czappstudio.com/ar/docs/installation/services).
9. Complete the [installation checklist](https://czappstudio.com/ar/docs/installation/checklist).

Align upload limits in PHP, Nginx and application validation. This starting configuration still needs acceptance on the exact Linux/PHP stack.
