# How to Install Zen Cart on Ubuntu 22.04

> URL: https://www.atlantic.net/dedicated-server-hosting/how-to-install-zen-cart-on-ubuntu-22-04/ | Published: 2024-07-13 | Updated: 2024-07-15 | Author: Hitesh Jethva

Zen Cart is an open-source software program that allows you to set up and manage an online store. It’s free to use and considered user-friendly, making it a popular choice for those starting out with e-commerce. Zen Cart is a solid option for those looking for a free and easy-to-use platform to set up a basic online store.

In this tutorial, we will show you how to install Zen Cart on Ubuntu 22.04.

## Step 1 – Install LAMP Server

First, install the Apache, MariaDB, PHP and other required PHP extensions using the following command:

```bash
apt install -y apache2 mariadb-server php php-cli php-common libapache2-mod-php php-curl php-zip php-gd php-mysql php-xml php-mbstring php-json php-intl
```

Next, edit the PHP configuration file:

```bash
nano /etc/php/8.1/apache2/php.ini
```

Change the default values of the following settings:

```bash
memory_limit = 512M
post_max_size = 128M
upload_max_filesize = 128M
date.timezone = America/Chicago
```

Save the file, then restart the Apache service to implement the changes.

```bash
systemctl restart apache2
```

## Step 2 – Create a Database and User

First, log in to your MariaDB shell:

```bash
mysql
```

After the successful connection, create a database and user for Zen Cart:

```bash
CREATE DATABASE zencart;
CREATE USER 'zencart'@'localhost' IDENTIFIED BY 'password';
```

Next, grant all the privileges to Zen Cart.

```bash
GRANT ALL PRIVILEGES ON zencart. * TO 'zencart'@'localhost';
```

Next, flush the privileges and exit from the MariaDB shell:

```bash
FLUSH PRIVILEGES;
EXIT;
```

## Step 3 – Download Zen Cart

First, go to the Zen Cart official download page and download the latest Zen Cart archive.

```bash
wget https://github.com/zencart/zencart/archive/refs/tags/v2.0.0.zip --no-check-certificate
```

Then, unzip the downloaded archive:

```bash
unzip v2.0.0.zip
```

Next, move the extracted directory to the Apache web root:

```bash
mv zencart-2.0.0 /var/www/html/zencart
```

Next, copy the Zen Cart sample configuration file.

```bash
cp /var/www/html/zencart/includes/dist-configure.php /var/www/html/zencart/includes/configure.php
```

Next, change the ownership and permission of the Zen Cart directory.

```bash
chown -R www-data:www-data /var/www/html/zencart
find /var/www/html/zencart/ -type d -exec chmod 755 {} \;
find /var/www/html/zencart/ -type f -exec chmod 644 {} \;
```

## Step 4 – Create an Apache Virtual Host

Next, you will need to create an Apache virtual host configuration file for Zen Cart.

```bash
nano /etc/apache2/sites-available/zencart.conf
```

Add the following content:

```bash

 <VirtualHost *:80>
    ServerAdmin admin@example.com
    DocumentRoot /var/www/html/zencart/
    
    ServerName zencart.example.com

    <Directory /var/www/html/zencart/> 
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog /var/log/apache2/example.com-error_log
    CustomLog /var/log/apache2/example.com-access_log common

 </VirtualHost>
```

Save the file then activate the Zen Cart virtual host.

```bash
a2ensite zencart.conf
```

Finally, restart the Apache service to apply the changes.

```bash
systemctl restart apache2
```

## Step 5 – Access Zen Cart Web Interface

Now, open your web browser and access the Zen Cart UI using the URL http://zencart.example.com. You will see the following page:

![Zen Cart welcome page prompting a first time installation to click here to begin](https://www.atlantic.net/wp-content/uploads/2024/05/p1-3.png)

Click on **CLICK HERE.** You will see the system inspection page:

![Zen Cart installer System Inspection page listing PHP version and htaccess issues](https://www.atlantic.net/wp-content/uploads/2024/05/p2-2.png)

Click on **Continue.** You will see the License Agreement and settings page:

![Zen Cart installer license and admin settings step with storefront domain fields](https://www.atlantic.net/wp-content/uploads/2024/05/p3-2.png)

Accept the License Agreement, define other necessary settings, and click on **Continue.** You will see the database setup page:

![Zen Cart installer Database Setup step with database host, user and password fields](https://www.atlantic.net/wp-content/uploads/2024/05/p4-2.png)

Provide your database credentials and click on **Continue.** You will see the admin setup page:

![Zen Cart installer Admin Setup step showing the generated admin password and directory name](https://www.atlantic.net/wp-content/uploads/2024/05/p5-1.png)

Set your admin username, email, and password, and click on **Continue.** You will see the following page:

![Zen Cart installer Setup Complete page with links to the admin dashboard and storefront](https://www.atlantic.net/wp-content/uploads/2024/05/p6-1.png)

Now, delete the installation directory from your server using the following command.

```bash
rm -rf /var/www/html/zencart/zc_install
```

Next, click on the **Admin Dashboard** link. You will see the following page:

![Zen Cart Admin Login page with username and password fields](https://www.atlantic.net/wp-content/uploads/2024/05/p7-1.png)

Provide your admin username and password and click on **Submit.** You will see the password reset page:

![Zen Cart admin password expired page requiring a new password to be set](https://www.atlantic.net/wp-content/uploads/2024/05/p8-1.png)

Change your admin password and click on **Submit.** You will see the Initial Setup page.

![Zen Cart Initial Setup Wizard form for store name, owner and address details](https://www.atlantic.net/wp-content/uploads/2024/05/p9-1.png)

Provide your store information and click on **Update.** You will see the Zen Cart dashboard.

![Zen Cart admin dashboard showing customer, order and sales statistics panels](https://www.atlantic.net/wp-content/uploads/2024/05/p10-1.png)

## Conclusion

Zen Cart offers a powerful and flexible solution for e-commerce, and with this guide, you can confidently set it up on your Ubuntu 22.04 server. Whether you are setting up a new store or migrating an existing one, you now have the knowledge to manage your installation effectively. Enjoy the capabilities of Zen Cart and start building your online presence today! You can now host your own online store using Zen Cart on [dedicated server hosting](https://www.atlantic.net/dedicated-server-hosting/) from Atlantic.Net!
