Skip to content

Installation

Lenny P. edited this page Jul 28, 2025 · 4 revisions

This guide will walk you through how to install CyanFox Base

Requirements

  • Debian or Ubuntu
  • Caddy (or any other web server)
  • PHP >= 8.4
  • Composer
  • Node.js & npm
  • Git
  • MySQL or PostgreSQL (or another database supported by Laravel)

1. Install System Requirements

# Make sure the system is up to date
apt update
apt upgrade

# Install Dependencies
apt install ca-certificates apt-transport-https lsb-release gnupg curl nano unzip -y

# For Debian
curl -fsSL https://packages.sury.org/php/apt.gpg -o /usr/share/keyrings/php-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/php-archive-keyring.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list

# For Ubuntu
apt install software-properties-common -y
add-apt-repository ppa:ondrej/php

# Update again
apt update

# Install packages
apt -y install php8.4 php8.4-{common,cli,gd,mysql,mbstring,bcmath,xml,fpm,curl,zip} mariadb-server caddy tar git

# Install composer
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

# We use the node version manager to install nodejs & npm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
source ~/.bashrc # Or any other shell config file
nvm install --lts

2. Clone the Repository

We will put the Base System in /var/www/Base

mkdir -p /var/www && cd /var/www
git clone https://github.com/CyanFox/Base && cd Base

3. Setup

cd /var/www/Base

# Copy .env.example file
cp .env.example .env

# Set permissions
chmod -R 755 storage/* bootstrap/cache/
chown -R www-data:www-data .

# Install composer packages
composer update

# Install npm packages
npm i

# Generate Key
php artisan key:generate --force

# Build npm packages
npm run build

4. Database Setup

# If using MariaDB (v11.0.0+)
mariadb -u root -p

# If using MySQL
mysql -u root -p

# Create a user and database
CREATE USER 'base'@'127.0.0.1' IDENTIFIED BY 'password';
CREATE DATABASE base;
GRANT ALL PRIVILEGES ON base.* TO 'base'@'127.0.0.1' WITH GRANT OPTION;
exit

cd /var/www/Base

# Change .env DB_ values
nano .env

# Migrate database
php artisan migrate --seed --force

5. Additional Configuration

# Discover settings
php artisan settings:discover

6. Webserver configuration

# We start with a empty Caddyfile
rm /etc/caddy/Caddyfile && nano /etc/caddy/Caddyfile

Insert this and replace the placeholders

<domain> {
    root * /var/www/Base/public

    file_server

    php_fastcgi unix//run/php/php8.4-fpm.sock {
        root /var/www/Base/public
        index index.php

        read_timeout 300s
        dial_timeout 300s
        write_timeout 300s
    }

    header Strict-Transport-Security "max-age=16768000; preload;"
    header X-Content-Type-Options "nosniff"
    header X-XSS-Protection "1; mode=block;"
    header X-Robots-Tag "none"
    header Content-Security-Policy "frame-ancestors 'self'"
    header X-Frame-Options "DENY"
    header Referrer-Policy "same-origin"

    request_body {
        max_size 100m
    }

    respond /.ht* 403

    log {
        output file /var/log/caddy/base.log {
            roll_size 100MiB
            roll_keep_for 7d
        }
        level INFO
    }
}
Clone this wiki locally