Docs Installation Advanced Installation (CLI)

Advanced Installation (CLI)

Manual command-line installation for developers and advanced server setups.

15 views Updated 1 week ago

Advanced Installation (CLI)

This guide is for developers and system administrators who prefer full control over the installation process using the command line. If you are not comfortable with terminal commands, use the Installation Wizard (install.php) instead.

Prerequisites

Make sure you have the following installed on your server:

  • PHP 8.1+ with required extensions
  • Composer 2.x
  • Node.js 18+ and NPM 9+
  • MySQL 8.0+ or PostgreSQL 13+
  • Git (optional, for version control)

Step 1 — Download and Extract

Download the latest release and extract it to your web server directory:

cd /var/www

unzip mangareader-pro-v3.zip

cd mangareader-pro

Or clone from the private repository if you have Git access:

git clone https://github.com/your-org/mangareader-pro.git

cd mangareader-pro

Step 2 — Install PHP Dependencies

composer install --optimize-autoloader --no-dev

For development environments, omit the --no-dev flag:

composer install

Step 3 — Install Frontend Dependencies

npm install

npm run build

For development with hot-reloading:

npm run dev

Step 4 — Environment Configuration

Copy the example environment file and generate an application key:

cp .env.example .env

php artisan key:generate

Step 5 — Database Setup

Create a new MySQL database:

mysql -u root -p

CREATE DATABASE mangareader CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

CREATE USER 'mangareader'@'localhost' IDENTIFIED BY 'your_secure_password';

GRANT ALL PRIVILEGES ON mangareader.* TO 'mangareader'@'localhost';

FLUSH PRIVILEGES;

EXIT;

Update your .env file with the database credentials:

DB_CONNECTION=mysql

DB_HOST=127.0.0.1

DB_PORT=3306

DB_DATABASE=mangareader

DB_USERNAME=mangareader

DB_PASSWORD=your_secure_password

Step 6 — Run Migrations and Seeders

php artisan migrate --seed

This creates all database tables and populates them with default roles, settings, and optional demo content.

Step 7 — Set File Permissions

chmod -R 775 storage bootstrap/cache

chown -R www-data:www-data storage bootstrap/cache

> [!NOTE] Replace www-data with your web server user (e.g., nginx, apache, or http depending on your OS).

Create the storage symlink:

php artisan storage:link

Step 8 — Web Server Configuration

Nginx Example:

server {

listen 80;

server_name your-domain.com;

root /var/www/mangareader-pro/public;

index index.php;

location / {

try_files $uri $uri/ /index.php?$query_string;

}

location ~ \.php$ {

fastcgi_pass unix:/run/php/php8.2-fpm.sock;

fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;

include fastcgi_params;

}

}

Apache — The .htaccess file is included by default. Make sure mod_rewrite is enabled:

sudo a2enmod rewrite

sudo systemctl restart apache2

> [!WARNING] Always point your web server document root to the public/ directory. Never expose the application root.

Step 9 — Production Optimization

Run these commands to optimize for production:

php artisan config:cache

php artisan route:cache

php artisan view:cache

php artisan event:cache

composer install --optimize-autoloader --no-dev

Step 10 — Queue Worker and Scheduler

Set up the queue worker for background jobs (email, image processing):

php artisan queue:work --daemon --sleep=3 --tries=3

Use Supervisor for persistent queue processing. Example config:

[program:mangareader-worker]

process_name=%(program_name)s_%(process_num)02d

command=php /var/www/mangareader-pro/artisan queue:work --sleep=3 --tries=3 --max-time=3600

autostart=true

autorestart=true

user=www-data

numprocs=2

redirect_stderr=true

stdout_logfile=/var/www/mangareader-pro/storage/logs/worker.log

Add the scheduler to your crontab:

* * * * * cd /var/www/mangareader-pro && php artisan schedule:run >> /dev/null 2>&1

Step 11 — SSL Certificate

Install a free SSL certificate with Certbot:

sudo apt install certbot python3-certbot-nginx

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

Update APP_URL in .env:

APP_URL=https://your-domain.com

Optional — Redis Setup

For best performance, install and configure Redis:

sudo apt install redis-server

Update .env:

CACHE_DRIVER=redis

SESSION_DRIVER=redis

QUEUE_CONNECTION=redis

> [!TIP] Redis dramatically improves performance for caching, sessions, and queue processing. Highly recommended for production.

Verify Installation

php artisan about

This shows your application configuration summary. Visit your domain to confirm everything is working.

Was this article helpful?