---
url: https://docs.corbitaltech.dev/products/whatsmark-saas/installation/aapanel.md
description: >-
  Complete aaPanel installation guide for WhatsMark SaaS. Configure PHP 8.3+,
  MySQL, file permissions, ownership, virtual host, and run the installation
  wizard on aaPanel hosting.
---

# AApanel Installation Guide

::: warning Important
AApanel uses a different file-ownership model compared to cPanel or CloudPanel.io. **This sometimes causes file permission errors after uploading or extracting the script.**

**This is not a script issue — it's AApanel's default behavior. Following this guide will fix it permanently.**
:::

This guide ensures a clean and smooth installation on AApanel.

## Why AApanel Needs Special Attention

AApanel often extracts or uploads files under the `root` user, while PHP-FPM runs under `www` or `www-data`. This user mismatch causes common errors like:

* Permission denied
* Storage not writable
* Unable to create symlink
* Logs not being generated
* Queue failing

***

## Step 1: Create the Website in AApanel

1. Open **AApanel** → **Website** → **Add Site**
2. Set your domain name (e.g., `yourdomain.com`)
3. Choose the following settings:
   * **PHP version**: 8.1+ (recommended: **8.2** or **8.3**)
   * **Database**: MySQL
   * **Create FTP**: Optional
4. Click **Submit** to create the site

After creation, note your installation path:

```bash
/www/wwwroot/YOURDOMAIN
```

***

## Step 2: Upload the Script

You can upload the WhatsMarkSaaS script in two ways:

### Option A: Using File Manager

1. Open **AApanel** → **Files**
2. Navigate to `/www/wwwroot/YOURDOMAIN`
3. Upload the `.zip` file
4. Right-click and select **Extract**

### Option B: Using SSH

```bash
cd /www/wwwroot/YOURDOMAIN
unzip whatsmarksaas.zip
```

::: tip
Make sure to extract/upload files **inside** the domain directory, not in a subdirectory.
:::

***

## Step 3: Fix File Ownership (Most Important Step)

AApanel often extracts files under the `root` user, but PHP-FPM runs under `www` or `www-data`. This mismatch causes **all permission errors**.

### For CentOS / AApanel Default (user: `www`)

```bash
chown -R www:www /www/wwwroot/YOURDOMAIN
```

### For Ubuntu/Debian (user: `www-data`)

```bash
chown -R www-data:www-data /www/wwwroot/YOURDOMAIN
```

::: warning Important
Replace `YOURDOMAIN` with your actual domain path (e.g., `demo.example.com`)
:::

***

## Step 4: Set Proper Folder Permissions

Laravel needs write access to specific directories:

* `/storage`
* `/bootstrap/cache`
* `/public/uploads` (if using file uploads)

Run the following commands:

```bash
chmod -R 775 /www/wwwroot/YOURDOMAIN/storage
chmod -R 775 /www/wwwroot/YOURDOMAIN/bootstrap/cache
```

If your script handles file uploads:

```bash
chmod -R 775 /www/wwwroot/YOURDOMAIN/public/uploads
```

### Set Permissions via AApanel GUI (Alternative Method)

You can also set permissions through AApanel's File Manager:

1. Navigate to your domain folder
2. Right-click on `storage` or `bootstrap/cache` folders
3. Select **Permission** and set to `775`

![Set File Permissions](https://www.aapanel.com/forum/assets/files/2019-06-27/1561631244-295416-permission1.png)

***

## Step 5: Configure PHP Settings

1. Open **AApanel** → **App Store** → **PHP Settings** → Select your PHP version
2. Click **Install Extensions** and enable the following:

**Required Extensions:**

* fileinfo
* pdo_mysql
* openssl
* mbstring
* zip
* curl
* exif
* bcmath
* sockets

**Recommended Extensions:**

* opcache (for better performance)
* redis (for caching and queues)

1. Go to **Disabled Functions** tab

2. Remove these functions if listed (Laravel needs them):

   * `proc_open`
   * `putenv`
   * `pcntl_*` (all pcntl functions)

3. Click **Save** and restart PHP-FPM

***

## Step 6: Set Correct Document Root

Ensure your website points to the `public` directory:

```
/www/wwwroot/YOURDOMAIN/public
```

### How to Set Document Root

1. **AApanel** → **Website** → Select your site
2. Click **Site Directory**
3. Set **Running Directory** to `/public`
4. Click **Save**

***

## Step 7: Using Web Installer

If your script includes a web-based installer, visit:

```
https://yourdomain.com/install
```

Follow the on-screen prompts to complete the installation.

## Step 8: Setup Cron Jobs

WhatsMarkSaaS requires cron jobs for scheduled tasks.

### Add Cron Job in AApanel

1. **AApanel** → **Cron**
2. Click **Add Cron**
3. Configure as follows:

**Type**: Shell Script

**Name**: WhatsMarkSaaS Scheduler

**Execution Cycle**: Every minute (`*/1 * * * *`)

**Script Content**:

```bash
cd /www/wwwroot/YOURDOMAIN && php artisan schedule:run >> /dev/null 2>&1
```

1. Click **Save**

### Setup Laravel Horizon (if using queues)

Refer to the [Supervisor Setup Guide](../advance-configuration/supervisor-setup-guide-for-laravel-horizon.md) for detailed configuration.

***

## Step 9: Restart PHP & Nginx

Always restart services after installation:

1. **AApanel** → **App Store** → **Installed**
2. Click **Restart** next to:
   * **PHP** (your version)
   * **Nginx** or **Apache**

Alternatively, use SSH:

```bash
# Restart PHP-FPM
systemctl restart php-fpm-82  # Replace 82 with your PHP version

# Restart Nginx
systemctl restart nginx

# Or Apache
systemctl restart httpd
```

***

## Final Notes

* AApanel is powerful but requires **manual permission correction** because its extraction system sets ownership to `root`.
* Once ownership & permissions are fixed using the steps above, WhatsMarkSaaS runs smoothly.
* Always use the `www` user (or `www-data` on Ubuntu) when running Artisan commands.
* Regularly check logs at `storage/logs/laravel.log` for any issues.

***

## Additional Resources

* [System Requirements](../system-requirements.md)
* [Setup Guide](../setup.md)
* [SSL Setup Guide](./ssl-setup.md)
* [Cron Job Setup](./cron-jobs.md)
* [Supervisor Setup](../advance-configuration/supervisor-setup-guide-for-laravel-horizon.md)
* [FAQ](../faq.md)

***

::: tip Need Help?
If you still face issues after following this guide, please:

1. Check the [FAQ section](../faq.md)
2. Review `storage/logs/laravel.log` for error details
3. Contact our [support team](https://support.corbitaltech.dev/)
   :::
