Skip to content

Deployment ​

V2 release guide

This page describes older V2 releases. Use current deployment for the Laravel 13 code. Select a release tag before installing dependencies.

To properly deploy this application, you'll need to follow a few steps, it is quite similar to the installation process in someways and the requirements remain the same.

WARNING

You are better off deploying on a VPS than in a shared hosting environment, and there is no guarantee this project would work properly in a shared hosting environment

Also checkout the laravel deployment page which might contain other useful information.

Fetching the code ​

Just like we have seen in the install, you can fetch the code from two sources, git or composer. Make sure the project still retains it's vcs folder and can pull code from the remote repository, luckily a git clone already ensures this while you can acheive this by including the --keep-vcs flag while installing with composer

Composer

shell
composer create-project yungifez/skuul folder-name '^2.0' --keep-vcs
composer create-project yungifez/skuul folder-name '^2.0' --keep-vcs

Git

shell
git clone --branch V2.6.4 https://github.com/yungifez/skuul.git folder-name
git clone --branch V2.6.4 https://github.com/yungifez/skuul.git folder-name

WARNING

It is absolutely necessary to keep the version control with the application unless updates wouldnt work

Installation ​

Installing is also quite similar, but now we have to focus on a reasonable level of folder security.

We would begin by installing composer dependencies

Navigate to the project's folder and install composer dependencies

shell
cd folder-name
cd folder-name
shell
composer install
composer install

Now run the installation wizard

WARNING

Make sure to pick production when installing the application

Set file permissions ​

Then we set appropriate file permissions

In this case, our webserver user is www-data, in some cases it might be apache or some other user. If you are unsure of this, you can contact your hosting company and enquire about this. Remember we are in the project's directory.

TIP

For this demonstration, we are using a linux user called ubuntu.

shell
sudo chown -R ubuntu:www-data storage bootstrap/cache
 sudo chmod -R ug+rwX storage bootstrap/cache
sudo chown -R ubuntu:www-data storage bootstrap/cache
 sudo chmod -R ug+rwX storage bootstrap/cache

WARNING

Permissions must be set correctly or update wizard might not work properly

Upload your application logo to img/logo/logo.jpg

TIP

You can specify another path in the .env file

Configuring your webserver ​

When configuring your webserver, point the entry directory to the public folder of the application and not the root folder of the application itself

Once your webserver has been properly configured, you can access the site and log in with the credentials you created in the install wizard

An example nginx configuration I use is

shell
server {
    if ($host = example.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    listen 80; 
    server_name example.com www.example.com;
    return 301 https://example.com$request_uri;


}
server {
    listen 443 ssl http2;
    server_name example.com www.example.com;
    root /var/www/sites/example.com/public;
    ssl_certificate /etc/letsencrypt/live/example.com-0001/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/example.com-0001/privkey.pem; # managed by Certbot

    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;
    }


}
server {
    if ($host = example.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    listen 80; 
    server_name example.com www.example.com;
    return 301 https://example.com$request_uri;


}
server {
    listen 443 ssl http2;
    server_name example.com www.example.com;
    root /var/www/sites/example.com/public;
    ssl_certificate /etc/letsencrypt/live/example.com-0001/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/example.com-0001/privkey.pem; # managed by Certbot

    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;
    }


}