1
System Requirements
PHP
8.2 or higher
Node.js
18.x or higher + npm
MySQL / MariaDB
8.0+ / 10.3+ recommended
Web Server
Apache 2.4+ or Nginx
Composer
2.x (PHP dependency manager)
PHP Extensions
BCMath, Ctype, JSON, Mbstring, OpenSSL, PDO, Tokenizer, XML, Fileinfo, cURL
2
Quick Install (One Command)
⚡ Fastest Way to Install
If you've already configured your .env file, run this single command to set everything up:
Terminal
composer setup
This command runs:
composer install → copy .env → generate key → run migrations → npm install → npm run build. You still need to configure your .env database credentials BEFORE running this.3
Step-by-Step Installation
1
Upload Files to Server
Upload all project files to your server using FTP, Git, or file manager. Place them in your desired directory.
Option A: Git Clone
# Clone to your web directory
cd /var/www
git clone https://your-repo-url.git rentdesk
cd rentdesk
Option B: Upload ZIP
# Extract uploaded ZIP file
unzip rentdesk.zip -d /var/www/rentdesk
cd /var/www/rentdesk
2
Install PHP Dependencies
Install all Laravel and PHP packages via Composer.
Terminal
composer install --optimize-autoloader --no-dev
Use
--no-dev on production servers to skip development-only packages (PHPUnit, Faker, etc.).3
Configure Environment
Copy the example environment file and generate the application encryption key.
Terminal
# Copy env file
cp .env.example .env
# Generate application key
php artisan key:generate
Now edit the
.env file with your server settings (see Section 4 below).4
Create Database
Create a MySQL database for RentDesk.
MySQL
CREATE DATABASE rentdesk CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'rentdesk_user'@'localhost' IDENTIFIED BY 'YourStrongPassword';
GRANT ALL PRIVILEGES ON rentdesk.* TO 'rentdesk_user'@'localhost';
FLUSH PRIVILEGES;
On cPanel, use the MySQL Databases section to create the database and user through the GUI instead.
5
Run Migrations & Seed
Create all database tables and seed default data (admin user, settings, categories).
Terminal
# Run migrations
php artisan migrate --force
# Seed default data (admin user, settings, categories)
php artisan db:seed --force
Default Admin Login:
Email:
Password:
⚠️ Change this password immediately after first login!
Email:
admin@rentdesk.comPassword:
password⚠️ Change this password immediately after first login!
6
Install Node Dependencies & Build Frontend
Install JavaScript packages and compile the React frontend for production.
Terminal
# Install Node.js packages
npm install
# Build for production
npm run build
7
Create Storage Link
Link the storage directory for file uploads (receipts, proofs, etc.).
Terminal
php artisan storage:link
8
Optimize for Production
Cache configuration, routes, and views for maximum performance.
Terminal
# Cache everything for production
php artisan config:cache
php artisan route:cache
php artisan view:cache
php artisan icons:cache
# Or use the optimize shortcut
php artisan optimize
4
Environment Configuration
🔑 Essential Settings in .env
| Variable | Production Value | Description |
|---|---|---|
| APP_NAME | RentDesk |
Your application name |
| APP_ENV | production |
Must be "production" on live server |
| APP_DEBUG | false |
⚠️ MUST be false in production |
| APP_URL | https://yourdomain.com |
Your full domain URL with https |
| DB_CONNECTION | mysql |
Database driver |
| DB_HOST | 127.0.0.1 |
Database host (usually localhost) |
| DB_PORT | 3306 |
MySQL default port |
| DB_DATABASE | rentdesk |
Database name you created |
| DB_USERNAME | rentdesk_user |
Database username |
| DB_PASSWORD | YourStrongPassword |
Database password |
Sample Production .env
APP_NAME=RentDesk
APP_ENV=production
APP_KEY=# Auto-generated by php artisan key:generate
APP_DEBUG=false
APP_URL=https://yourdomain.com
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=rentdesk
DB_USERNAME=rentdesk_user
DB_PASSWORD=YourSecurePassword123!
SESSION_DRIVER=database
CACHE_STORE=database
QUEUE_CONNECTION=database
VITE_APP_NAME="${APP_NAME}"
5
Web Server Configuration
CRITICAL: Your web server's document root must point to the
public/ directory, NOT the project root. This prevents exposing sensitive files like .env.Apache Virtual Host
/etc/apache2/sites-available/rentdesk.conf
<VirtualHost *:80>
ServerName yourdomain.com
ServerAlias www.yourdomain.com
DocumentRoot /var/www/rentdesk/public
<Directory /var/www/rentdesk/public>
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/rentdesk-error.log
CustomLog ${APACHE_LOG_DIR}/rentdesk-access.log combined
</VirtualHost>
Enable Site
sudo a2ensite rentdesk.conf
sudo a2enmod rewrite
sudo systemctl restart apache2
Nginx Server Block
/etc/nginx/sites-available/rentdesk
server {
listen 80;
server_name yourdomain.com www.yourdomain.com;
root /var/www/rentdesk/public;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
index index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
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;
}
}
Enable Site
sudo ln -s /etc/nginx/sites-available/rentdesk /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
cPanel Shared Hosting Setup
1
Upload Files
Upload all files to a folder ABOVE
public_html, e.g., /home/user/rentdesk/2
Move Public Contents
Copy contents of
rentdesk/public/ into public_html/3
Update index.php Paths
Edit
public_html/index.php to update the bootstrap paths:
public_html/index.php
// Change these lines:
require __DIR__.'/../vendor/autoload.php';
// To:
require __DIR__.'/../rentdesk/vendor/autoload.php';
// And:
$app = require_once __DIR__.'/../bootstrap/app.php';
// To:
$app = require_once __DIR__.'/../rentdesk/bootstrap/app.php';
4
Run Commands via SSH or Terminal
Use cPanel Terminal or SSH to run the artisan commands from the
rentdesk/ directory.6
File Permissions
Linux/Mac Permissions
# Set correct ownership (replace www-data with your web server user)
sudo chown -R www-data:www-data /var/www/rentdesk
# Set directory permissions
sudo find /var/www/rentdesk -type d -exec chmod 755 {} \;
# Set file permissions
sudo find /var/www/rentdesk -type f -exec chmod 644 {} \;
# Make storage and cache writable
sudo chmod -R 775 /var/www/rentdesk/storage
sudo chmod -R 775 /var/www/rentdesk/bootstrap/cache
On cPanel shared hosting, the web server user is typically your cPanel username. You may only need to set
storage/ and bootstrap/cache/ to 775.7
Security Checklist
🛡️ Pre-Launch Security Review
Click each item to mark as completed.
✓
APP_DEBUG = false — Never leave debug mode on in production. It exposes environment variables and stack traces.
✓
APP_ENV = production — Enables production optimizations and disables dev-only features.
✓
Change default admin password — Log in with
admin@rentdesk.com / password and change immediately.✓
Document root points to public/ — Never expose the project root. Only
public/ should be web-accessible.✓
.env file is not web-accessible — Test by visiting
yourdomain.com/.env — it should return 403 or 404.✓
HTTPS enabled — Use SSL/TLS certificate (Let's Encrypt is free). Redirect HTTP to HTTPS.
✓
Strong database password — Use a unique, complex password for the database user.
✓
Storage permissions are correct —
storage/ and bootstrap/cache/ writable by web server only.✓
Backup strategy in place — Automate daily database backups and periodic file backups.
8
Troubleshooting
🔴 500 Internal Server Error
Fix
# Check Laravel log for detailed error
tail -f storage/logs/laravel.log
# Make sure storage is writable
chmod -R 775 storage bootstrap/cache
# Clear all caches
php artisan optimize:clear
🔴 Blank White Page
Fix
# Frontend not built — run:
npm run build
# Or check if Vite manifest exists:
ls public/build/manifest.json
🔴 SQLSTATE Connection Refused
Fix
# Verify .env database credentials
# Try DB_HOST=localhost instead of 127.0.0.1 (or vice versa)
# Clear config cache after changing .env:
php artisan config:clear
🔴 Mixed Content / Assets Not Loading
Fix
# Make sure APP_URL uses https://
APP_URL=https://yourdomain.com
# Clear caches
php artisan config:clear
php artisan route:clear
🔴 Styles Look Broken
Fix
# Re-build frontend assets
npm run build
# Clear view cache
php artisan view:clear
🟡 Update / Re-deploy Checklist
After pulling new code
composer install --optimize-autoloader --no-dev
php artisan migrate --force
npm install
npm run build
php artisan optimize
★
Complete Install Commands (Copy All)
Full Installation — Run in order
# 1. Navigate to project directory
cd /var/www/rentdesk
# 2. Install PHP dependencies
composer install --optimize-autoloader --no-dev
# 3. Set up environment
cp .env.example .env
php artisan key:generate
# 4. Edit .env with your database credentials
nano .env
# 5. Run migrations & seed
php artisan migrate --force
php artisan db:seed --force
# 6. Build frontend
npm install
npm run build
# 7. Storage link
php artisan storage:link
# 8. Set permissions
sudo chown -R www-data:www-data .
sudo chmod -R 775 storage bootstrap/cache
# 9. Optimize
php artisan optimize
# ✅ Done! Visit your domain to access RentDesk
# Login: admin@rentdesk.com / password