This guide will walk you through the process of installing Your Application on your server.
Before you begin, make sure your server meets the following requirements:
First, clone the repository to your local machine or server:
git clone https://github.com/yourusername/your-app.git
cd your-app
Install PHP dependencies using Composer:
composer install
Install frontend dependencies:
npm install
npm run build
Copy the example environment file and configure it with your database credentials:
cp .env.example .env
php artisan key:generate
Edit the .env
file and set your database connection details:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database
DB_USERNAME=your_username
DB_PASSWORD=your_password
Set up your database with the required tables:
php artisan migrate
Seed the database with initial data (optional):
php artisan db:seed
Point your web server to the public
directory of your application. Here's an example configuration for Nginx:
server {
listen 80;
server_name yourdomain.com;
root /path/to/your-app/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.1-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
If you encounter any issues during installation, please check the following:
For additional help, refer to the Troubleshooting Guide.