How to Install WinterCMS on Debian
WinterCMS is a powerful content management system based on the Laravel framework. In this tutorial, we will show you how to install WinterCMS on Debian 10.
Prerequisites
Before you start, you need to have the following prerequisites:
- A Debian 10 server
- A non-root user with sudo privileges
Step 1: Update System Packages
Before installing any packages, it is recommended to update the system packages to the latest version. You can do this by running the following command:
sudo apt update && sudo apt upgrade -y
Step 2: Install Required Packages
WinterCMS requires several packages to be installed on your system. You can install them using the following command:
sudo apt install nginx mariadb-server php php-fpm php-common php-mysql php-mbstring php-xmlrpc php-soap php-gd php-xml php-cli php-zip unzip curl wget -y
Step 3: Create a Database for WinterCMS
After installing the required packages, you need to create a database for WinterCMS. You can do this by following these steps:
Log in to the MariaDB server using the following command:
sudo mysql -u rootOnce you are logged in, create a new database using the following command:
MariaDB [(none)]> CREATE DATABASE wintercms CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;Create a new user and grant all privileges to the WinterCMS database using the following command:
MariaDB [(none)]> GRANT ALL ON wintercms.* TO 'wintercmsuser'@'localhost' IDENTIFIED BY 'your-password';Flush the privileges and exit from the MariaDB server using the following commands:
MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> EXIT;
Step 4: Install Composer
WinterCMS requires Composer to manage its dependencies. You can install Composer using the following command:
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
php -r "unlink('composer-setup.php');"
Step 5: Download and Install WinterCMS
After installing Composer, you can download the WinterCMS package from the official website using the following command:
sudo wget https://github.com/wintercms/winter/archive/master.zip
sudo unzip master.zip -d /var/www/
sudo mv /var/www/winter-master /var/www/winter
Next, you need to install the WinterCMS dependencies using the following commands:
cd /var/www/winter
sudo chown -R www-data:www-data /var/www/winter
sudo chmod -R 755 /var/www/winter
sudo -u www-data composer install
Step 6: Configure Nginx for WinterCMS
Next, you need to configure Nginx to serve WinterCMS. Create a new Nginx server block for WinterCMS using the following command:
sudo nano /etc/nginx/sites-available/wintercms.conf
Then, copy and paste the following Nginx configuration:
server {
listen 80;
server_name wintercms.com;
root /var/www/winter/public;
index index.php;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_index index.php;
}
}
Save and close the file by pressing CTRL+X, then Y and Enter.
Next, create a symbolic link of the file in sites-available to sites-enabled using the following command:
sudo ln -s /etc/nginx/sites-available/wintercms.conf /etc/nginx/sites-enabled/
Finally, test the Nginx configuration and restart Nginx using the following command:
sudo nginx -t
sudo systemctl restart nginx
Step 7: Complete the Installation
Finally, you can complete the installation process by accessing the WinterCMS installer via the web browser. To do this, open your web browser and navigate to http://your-server-ip/install.php.
Follow the instructions on the screen to create an admin account and complete the installation process.
That’s it! You have successfully installed WinterCMS on your Debian 10 server.