How to Install Thelia on Ubuntu Server Latest
Thelia is an open-source e-commerce solution that allows you to build and manage online stores. In this tutorial, we will show you how to install Thelia on Ubuntu Server.
Prerequisites
- Ubuntu Server (latest version)
- LAMP stack (Apache, MySQL, and PHP)
- Composer
- Git
Step 1: Update your system
Before starting the installation process, make sure your system is updated with the latest packages.
sudo apt-get update
sudo apt-get upgrade
Step 2: Install LAMP Stack
If you don't have LAMP stack installed on your server, you can install it using the following command:
sudo apt-get install apache2 mysql-server php7.4 libapache2-mod-php7.4 php-mysql
After the installation, start the Apache and MySQL services, and enable them to start automatically on system restart.
sudo systemctl start apache2
sudo systemctl start mysql
sudo systemctl enable apache2
sudo systemctl enable mysql
Step 3: Install Dependencies
Thelia requires some dependencies to be installed beforehand. Install the dependencies using the following command:
sudo apt-get install php-curl php-gd php-intl php-json php-mbstring php-xml php-zip php-cli unzip
Step 4: Install Composer
Composer is a dependency manager for PHP. You can install the latest version of Composer using the following command:
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
Step 5: Clone Thelia
Clone the Thelia repository using the following command:
cd /var/www/html/
sudo git clone https://github.com/thelia/thelia.git
Step 6: Install Thelia
Change the current directory to the Thelia root directory, and run the following commands:
cd thelia/
sudo composer install
This command installs all the required dependencies for Thelia.
Step 7: Configure the Database
Create an empty database and user for Thelia using the following command:
sudo mysql -u root -p
Enter your MySQL root user password when prompted. Once you are in the MySQL console, execute the following commands:
CREATE DATABASE thelia;
CREATE USER 'thelia_user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON thelia.* TO 'thelia_user'@'localhost';
FLUSH PRIVILEGES;
exit;
Replace password with your preferred password.
Step 8: Configure Thelia
Copy the .env.dist file and create a new .env file using the following command:
sudo cp .env.dist .env
Open the .env file and set the following variables:
DATABASE_URL=mysql://thelia_user:password@localhost/thelia
SMTP_HOST=localhost
SMTP_PORT=1025
SECRET=secret-key
Replace password with the password you set in Step 7, and replace secret-key with your preferred secret key.
Step 9: Generate Key
Run the following command to generate the key:
sudo php Thelia generate:key
This command generates a unique key for your Thelia installation.
Step 10: Install Thelia
Run the following command to complete the installation:
sudo php Thelia install
This command installs Thelia and sets up the database tables.
Step 11: Test Thelia
Open your web browser and navigate to your server's IP address or domain name. You should see the Thelia welcome screen.
Congratulations! You have successfully installed Thelia on your Ubuntu Server.