๐ฅ Installation
This guide walks you through installing Monitron SaaS on your server, step by step. We'll cover everything from uploading the files to running the setup wizard.
๐ฆ Step 1: Download & Extractโ
After purchasing Monitron SaaS from CodeCanyon:
- Download the ZIP file from your CodeCanyon downloads page
- Extract it to your desired location on the server
# Example: Extract to /var/www
cd /var/www
unzip monitron-saas.zip
This will create a monitron directory containing all the application files.
๐ Step 2: Understand the Directory Structureโ
Here's what's inside your Monitron installation:
monitron/
โโโ app/ # Application code (PHP)
โโโ bootstrap/ # Framework bootstrap files
โโโ config/ # Configuration files
โโโ database/ # Migrations and seeders
โโโ public/ # ๐ This is your web root!
โ โโโ index.php # Entry point
โ โโโ .htaccess # Apache rewrite rules
โ โโโ ...
โโโ resources/ # Views, assets, translations
โโโ routes/ # Route definitions
โโโ storage/ # Logs, cache, uploads
โโโ vendor/ # Composer dependencies
โโโ agent/ # Server agent scripts
โโโ .env.example # Environment config template
โโโ artisan # Laravel CLI tool
โโโ composer.json # PHP dependencies
๐จ CRITICAL: The public/ folder is your web root!
Your web server MUST point to the public/ directory, NOT the root monitron/ directory. Pointing to the root folder would expose your .env file (which contains your database password, API keys, etc.) to the internet!
๐ Step 3: Set File Permissionsโ
The web server needs write access to certain directories:
cd /var/www/monitron
# Set ownership to your web server user
# On Ubuntu/Debian with Nginx:
sudo chown -R www-data:www-data .
# On CentOS/RHEL with Nginx:
sudo chown -R nginx:nginx .
# On Apache (any distro):
sudo chown -R www-data:www-data .
Now set directory permissions:
# Directories that need to be writable
sudo chmod -R 775 storage/
sudo chmod -R 775 bootstrap/cache/
Why 775? This gives the owner and group full access (read, write, execute) while giving others only read and execute access. The web server user (www-data or nginx) should be the owner or in the group.
๐ Step 4: Create the .env Fileโ
The .env file holds your application's configuration. Create it from the example:
cp .env.example .env
Don't worry about editing .env manually! The Installation Wizard (Step 6) will configure the database and other settings for you through a friendly web interface.
๐ฆ Step 5: Dependencies & Application Keyโ
Monitron SaaS ships with all dependencies pre-installed in the vendor/ folder. No Composer required!
The Installation Wizard automatically generates a secure application key (APP_KEY) during setup. You don't need to run any artisan commands โ just proceed to the wizard!
For developers / advanced users: If you want to manage dependencies manually, you can run:
composer install --no-dev --optimize-autoloader
But this is entirely optional โ the included vendor/ directory has everything you need.
๐ Step 6: Configure Your Web Serverโ
Point your web server to the public/ directory. We have detailed guides for each web server:
- ๐ข Nginx Configuration
- ๐ Apache Configuration
- โก LiteSpeed Configuration
- ๐ก Caddy Configuration
- ๐ต IIS Configuration
After configuring your web server, verify you can reach the application by visiting your domain in a browser.
Using shared hosting (cPanel, Plesk, DirectAdmin)? We have a dedicated guide for you! ๐ Installing on Shared Hosting โ covers everything from uploading files to cron setup, with provider-specific instructions for Hostinger, Namecheap, SiteGround, Bluehost, GoDaddy, and A2 Hosting.
๐ง Step 7: Run the Installation Wizardโ
Now for the fun part! Open your browser and navigate to:
https://your-domain.com/install
The wizard will guide you through:
- Welcome โ Introduction and overview
- Requirements Check โ Verifies PHP extensions and permissions
- Database Setup โ Configure and test your database connection
- Admin Account โ Create your first administrator account
- Server Config โ Shows you web server, cron, and Supervisor configs
- Complete! โ You're done! ๐
๐ See the Installation Wizard page for a detailed walkthrough of each step.
โฐ Step 8: Set Up the Cron Jobโ
Monitron needs a single cron entry to dispatch scheduled checks. This is required for monitoring to work!
# Open the crontab editor for the web server user
sudo crontab -u www-data -e
Add this line:
* * * * * cd /var/www/monitron && php artisan schedule:run >> /dev/null 2>&1
What does this do? This tells your server to run Laravel's scheduler every minute. The scheduler then decides what needs to happen โ dispatching monitor checks, checking stale heartbeats, running AI predictions, purging old data, etc.
Verify the cron is working:โ
# Run it manually to test
cd /var/www/monitron
php artisan schedule:run
You should see output like:
Running [dispatch-monitor-checks] ... 10ms DONE
Running [check-stale-heartbeats] .... 5ms DONE
๐ Step 9: Set Up Queue Workersโ
Queue workers process monitoring checks asynchronously. Without them, Monitron won't perform any checks!
Option A: Using Supervisor (Recommended for Linux)โ
Install Supervisor:
# Ubuntu/Debian
sudo apt install supervisor
# CentOS/RHEL
sudo yum install supervisor
Create a Supervisor config file:
sudo nano /etc/supervisor/conf.d/monitron-worker.conf
Paste this configuration:
[program:monitron-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/monitron/artisan queue:work --sleep=3 --tries=3 --max-time=3600
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=www-data
numprocs=2
redirect_stderr=true
stdout_logfile=/var/www/monitron/storage/logs/worker.log
stopwaitsecs=3600
Let's explain each setting:
| Setting | What It Does |
|---|---|
process_name | Names each worker process uniquely |
command | The queue worker command |
--sleep=3 | Wait 3 seconds between checking for new jobs |
--tries=3 | Retry failed jobs up to 3 times |
--max-time=3600 | Restart the worker every hour (prevents memory leaks) |
autostart=true | Start automatically when Supervisor starts |
autorestart=true | Restart if the worker crashes |
user=www-data | Run as the web server user |
numprocs=2 | Run 2 worker processes (increase for more monitors) |
Now start the workers:
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start monitron-worker:*
Verify they're running:
sudo supervisorctl status
You should see:
monitron-worker:monitron-worker_00 RUNNING pid 12345, uptime 0:00:05
monitron-worker:monitron-worker_01 RUNNING pid 12346, uptime 0:00:05
Option B: Quick Testing (Not for Production)โ
For quick testing, you can run the queue worker manually:
cd /var/www/monitron
php artisan queue:work
Don't use this in production! The manual worker will stop when you close your terminal. Always use Supervisor (or similar) for production deployments.
โ Step 10: Verify Everything Worksโ
Let's make sure everything is running correctly:
1. Access the Dashboardโ
Visit https://your-domain.com/admin and log in with the admin credentials you created in the wizard.
2. Create a Test Monitorโ
- Click "Monitors" in the sidebar
- Click "New Monitor"
- Select "HTTP(S)" as the type
- Enter
https://www.google.comas the address - Set the interval to 1 minute
- Click Create
3. Check the Resultsโ
Wait about a minute, then:
- The monitor status should change from Pending to Up โ
- The response time should appear
- The uptime percentage should show