メインコンテンツまでスキップ

📥 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
危険

🚨 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:

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:

  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
備考

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
危険

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