> 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/cpanel-and-shared-hosting.md).

# cPanel & Shared Hosting

Installing on shared hosting, including when the document root cannot be changed.

Two scenarios. Try Scenario 1 first; use Scenario 2 only if your host will not let you change the document root.

{% hint style="info" %}
**The principle behind both.** Only `public/` should be reachable from the web. Everything else — including `.env`, which holds your database password — must sit outside the web root.
{% endhint %}

## Scenario 1 — you can set the document root

### 1. Create the database

cPanel → **MySQL® Databases**

1. Create a database, for example `myaccount_hollowpeak`
2. Create a user with a strong password
3. Add the user to the database with **ALL PRIVILEGES**

Write down the full names — cPanel prefixes both with your account name.

### 2. Upload

Upload the **contents of `application/`** to a directory *outside* `public_html`, for example `/home/myaccount/hollowpeak`.

Use **File Manager → Upload** with a zip, then **Extract**. This is far faster than FTP.

```
/home/myaccount/
├── hollowpeak/          ← the application
│   ├── app/
│   ├── public/          ← the only web-facing directory
│   ├── vendor/
│   └── ...
└── public_html/
```

### 3. Point the domain at `public/`

cPanel → **Domains** → set the document root to:

```
/home/myaccount/hollowpeak/public
```

### 4. Set the PHP version

cPanel → **MultiPHP Manager** → choose **8.2** or newer.

Then **Select PHP Version → Extensions** and confirm the required extensions are ticked.

### 5. Create `.env`

In File Manager, copy `.env.example` to `.env` and edit:

```ini
APP_NAME="Your Company"
APP_ENV=production
APP_DEBUG=false
APP_URL=https://your-domain.com

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_DATABASE=myaccount_hollowpeak
DB_USERNAME=myaccount_hpuser
DB_PASSWORD=your-database-password
```

{% hint style="info" %}
File Manager hides dotfiles by default. **Settings → Show Hidden Files.**
{% endhint %}

### 6. Run the installer

cPanel → **Terminal**:

```bash
cd ~/hollowpeak
php artisan key:generate
php artisan hollowpeak:install
```

Answer the three prompts. The password must be at least 12 characters with letters, numbers and a symbol.

**No Terminal?** Use cPanel → **Cron Jobs** to run it once, set a few minutes ahead:

```
cd ~/hollowpeak && /usr/local/bin/php artisan key:generate && /usr/local/bin/php artisan hollowpeak:install --no-interaction --admin-name="Your Name" --admin-email="you@example.com" --admin-password="ChooseAStrongPassword123!" >> ~/install.log 2>&1
```

Wait, check `install.log`, then **delete the cron job** — it contains your password.

### 7. Finish

```bash
php artisan storage:link
php artisan optimize
```

Visit `https://your-domain.com/staff/login`.

***

## Scenario 2 — the document root is locked to `public_html`

The application still stays outside the web root; only the front controller goes inside.

### 1. Upload

To `/home/myaccount/hollowpeak`, as above.

### 2. Copy the public files

Copy the **contents of `hollowpeak/public/`** into `public_html/`:

```
public_html/
├── index.php
├── .htaccess
├── favicon.ico
├── robots.txt
├── build/
├── css/
├── js/
└── images/
```

### 3. Edit `public_html/index.php`

**Three** paths point back into the application, and all three must change. The first is easy to miss — skipping it breaks maintenance mode.

Find:

```php
if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {

require __DIR__.'/../vendor/autoload.php';

(require_once __DIR__.'/../bootstrap/app.php')
```

Change each `/../` to `/../hollowpeak/`:

```php
if (file_exists($maintenance = __DIR__.'/../hollowpeak/storage/framework/maintenance.php')) {

require __DIR__.'/../hollowpeak/vendor/autoload.php';

(require_once __DIR__.'/../hollowpeak/bootstrap/app.php')
```

{% hint style="warning" %}
Keep a note of this change. Updating Hollow Peak replaces `index.php` and you will need to reapply it.
{% endhint %}

### 4. Install

As in Scenario 1, steps 5 and 6.

### 5. The storage link

`storage:link` points at the wrong place in this layout. Create it manually:

```bash
ln -s /home/myaccount/hollowpeak/storage/app/public /home/myaccount/public_html/storage
```

If your host forbids symlinks, set `FILESYSTEM_DISK=public` in `.env` and ask support to enable them — uploaded images will not display until a link exists.

***

## Verify before going live

Open `https://your-domain.com/.env`.

It must return **404 or 403**. If it shows file contents, stop and fix the layout — your database password is public.

## Common shared-hosting problems

| Symptom                         | Cause               | Fix                                     |
| ------------------------------- | ------------------- | --------------------------------------- |
| Blank page                      | PHP too old         | MultiPHP Manager → 8.2+                 |
| 500 on every page               | `APP_KEY` not set   | `php artisan key:generate`              |
| CSS and JS missing              | Document root wrong | Scenario 2                              |
| Images not displaying           | No storage link     | See step 5                              |
| “database could not be reached” | Wrong credentials   | cPanel prefixes database and user names |


---

# 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/cpanel-and-shared-hosting.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.
