Skip to main content

๐Ÿ“ฅ 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:

  1. Download the ZIP file from your CodeCanyon downloads page
  2. 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
danger

๐Ÿšจ 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/
info

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
info

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!

tip

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!

info

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:

After configuring your web server, verify you can reach the application by visiting your domain in a browser.

info

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:

  1. Welcome โ€” Introduction and overview
  2. Requirements Check โ€” Verifies PHP extensions and permissions
  3. Database Setup โ€” Configure and test your database connection
  4. Admin Account โ€” Create your first administrator account
  5. Server Config โ€” Shows you web server, cron, and Supervisor configs
  6. 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
info

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!

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:

SettingWhat It Does
process_nameNames each worker process uniquely
commandThe queue worker command
--sleep=3Wait 3 seconds between checking for new jobs
--tries=3Retry failed jobs up to 3 times
--max-time=3600Restart the worker every hour (prevents memory leaks)
autostart=trueStart automatically when Supervisor starts
autorestart=trueRestart if the worker crashes
user=www-dataRun as the web server user
numprocs=2Run 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
danger

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โ€‹

  1. Click "Monitors" in the sidebar
  2. Click "New Monitor"
  3. Select "HTTP(S)" as the type
  4. Enter https://www.google.com as the address
  5. Set the interval to 1 minute
  6. 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

4. Check Queue Workersโ€‹

php artisan queue:monitor

Or check the Supervisor status:

sudo supervisorctl status

๐ŸŽ‰ You're Done!โ€‹

Congratulations! Monitron SaaS is now installed and running. Here's what to do next:


๐Ÿ†˜ Having Trouble?โ€‹

  • Check the Troubleshooting page
  • Look at the Laravel log: storage/logs/laravel.log
  • Verify file permissions: ls -la storage/
  • Make sure the cron is running: crontab -l
  • Make sure queue workers are running: supervisorctl status