> For the complete documentation index, see [llms.txt](https://hollow-peak.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hollow-peak.gitbook.io/docs/installation/vps-installation.md).

# VPS Installation

Installing on a VPS or dedicated server, with Nginx or Apache.

## Install

```bash
cd /var/www
# upload and extract application/ here as /var/www/hollowpeak
cd hollowpeak

cp .env.example .env
php artisan key:generate
# edit .env — APP_URL and database credentials
php artisan hollowpeak:install
php artisan storage:link
```

## Permissions

Replace `www-data` with your web server user.

```bash
sudo chown -R www-data:www-data /var/www/hollowpeak
sudo find /var/www/hollowpeak -type d -exec chmod 755 {} \;
sudo find /var/www/hollowpeak -type f -exec chmod 644 {} \;
sudo chmod -R 775 storage bootstrap/cache
```

{% hint style="danger" %}
Never use `chmod 777`. If files are not writable, fix the **owner** rather than opening the permissions to everyone on the server.
{% endhint %}

## Nginx

```nginx
server {
    listen 80;
    server_name your-domain.com;
    root /var/www/hollowpeak/public;

    index index.php;
    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.(?!well-known).* { deny all; }

    client_max_body_size 64M;
}
```

```bash
sudo nginx -t && sudo systemctl reload nginx
```

## Apache

Enable `mod_rewrite`, set the document root to `public/`, and allow `.htaccess`:

```apache
<VirtualHost *:80>
    ServerName your-domain.com
    DocumentRoot /var/www/hollowpeak/public

    <Directory /var/www/hollowpeak/public>
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>
```

## HTTPS

```bash
sudo certbot --nginx -d your-domain.com
```

Then set `SESSION_SECURE_COOKIE=true` in `.env`.

## Production caching

After any `.env` or code change:

```bash
php artisan optimize
```

To undo it while debugging:

```bash
php artisan optimize:clear
```

{% hint style="warning" %}
If a configuration change seems to have no effect, this is almost always why.
{% endhint %}

## Scheduler

```bash
crontab -e
```

```
* * * * * cd /var/www/hollowpeak && php artisan schedule:run >> /dev/null 2>&1
```

## Queue worker (optional)

The default `QUEUE_CONNECTION=sync` needs no worker. To send email in the background instead, set `QUEUE_CONNECTION=database` and run a worker with Supervisor:

```ini
[program:hollowpeak-worker]
command=php /var/www/hollowpeak/artisan queue:work --sleep=3 --tries=3
autostart=true
autorestart=true
user=www-data
numprocs=1
redirect_stderr=true
stdout_logfile=/var/log/hollowpeak-worker.log
```

```bash
sudo supervisorctl reread && sudo supervisorctl update
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hollow-peak.gitbook.io/docs/installation/vps-installation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
