Overview
This guide covers installing Larapen via the command line (SSH) on a VPS, dedicated server, or any environment with terminal access. This is the recommended method for developers and technical users.
Prerequisites
- SSH access to your server
- PHP 8.3+ with required extensions installed
- Composer 2.x installed globally
- Node.js 18+ (for Vite asset builds)
- MySQL 8.0+ server running
- A web server (Apache or Nginx) configured
- The Larapen ZIP file from CodeCanyon
Step 1: Create the database
Connect to MySQL and create the database and user:
mysql -u root -p
CREATE DATABASE larapen CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'larapen_user'@'localhost' IDENTIFIED BY 'your_strong_password';
GRANT ALL PRIVILEGES ON larapen.* TO 'larapen_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Step 2: Upload and extract the files
Transfer the Larapen ZIP to your server and extract it:
# Upload via SCP (from your local machine)
scp larapen.zip user@yourserver:/tmp/
# On the server, extract to the web root
cd /var/www
unzip /tmp/larapen.zip -d larapen
cd larapen
Step 3: Set directory permissions
# Set ownership to the web server user (www-data for Apache/Nginx on Ubuntu)
sudo chown -R www-data:www-data /var/www/larapen
# Set directory permissions
sudo find /var/www/larapen -type d -exec chmod 755 {} \;
sudo find /var/www/larapen -type f -exec chmod 644 {} \;
# Make storage and cache writable
sudo chmod -R 775 storage bootstrap/cache
Step 4: Configure the web server
Apache
Create a virtual host configuration:
sudo nano /etc/apache2/sites-available/larapen.conf
<VirtualHost *:80>
ServerName yourdomain.com
ServerAlias www.yourdomain.com
DocumentRoot /var/www/larapen/public
<Directory /var/www/larapen/public>
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/larapen-error.log
CustomLog ${APACHE_LOG_DIR}/larapen-access.log combined
</VirtualHost>
# Enable the site and rewrite module
sudo a2ensite larapen.conf
sudo a2enmod rewrite
sudo systemctl reload apache2
Nginx
Create a server block configuration:
sudo nano /etc/nginx/sites-available/larapen
server {
listen 80;
server_name yourdomain.com www.yourdomain.com;
root /var/www/larapen/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 the site
sudo ln -s /etc/nginx/sites-available/larapen /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
Step 5: Run the web installer
- Open your browser and go to:
https://yourdomain.com/install - The Larapen web installation wizard will launch automatically.
- Follow the wizard steps: requirements check, permissions check, database setup, admin account creation, and site settings.
- Click "Install" and wait for the process to complete.
/admin using the administrator credentials you created during setup.
Step 6: Set up SSL
# Install Certbot (if not already installed)
sudo apt install certbot python3-certbot-apache # for Apache
# OR
sudo apt install certbot python3-certbot-nginx # for Nginx
# Obtain and install SSL certificate
sudo certbot --apache -d yourdomain.com -d www.yourdomain.com
# OR
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com
Update APP_URL in .env to use https://.
Step 7: Set up the cron job
sudo crontab -e -u www-data
Add this line:
* * * * * cd /var/www/larapen && php artisan schedule:run >> /dev/null 2>&1
Step 8: Optimize for production
# Cache configuration, routes, and views
php artisan config:cache
php artisan route:cache
php artisan view:cache
# Optional: set up the queue worker (for background jobs)
php artisan queue:work --daemon
APP_DEBUG=false and APP_ENV=production in the .env file on production servers. Leaving debug mode enabled exposes sensitive information.
Step 9: Verify the installation
- Visit
https://yourdomain.com— your website should display. - Visit
https://yourdomain.com/admin— log in with your admin credentials.