Come hang with us on Discord and chat directly with the team!Discordtop-bar-close-icon

2024-09-04

How to Install Groceri.es on Debian Latest

tutorials
img

Groceri.es is a versatile open-source application designed to streamline grocery list management. As a web-based application, it allows access from any device connected to the internet. This guide will walk you through installing Groceri.es on the latest version of Debian.

Prerequisites

Ensure you have the following prerequisites before proceeding with the installation:

  • A server running the latest Debian
  • A non-root user with sudo privileges
  • An installed web server, such as Apache or Nginx
  • PHP and Composer

Step 1 – Clone Github Repository

Begin by cloning the Groceri.es repository from GitHub. Use the terminal to navigate to the directory where Groceri.es will be installed:

cd /var/www/html

Execute the following command to clone the repository:

sudo git clone https://github.com/jstnryan/groceri.es.git

This action will create a directory named groceri.es within /var/www/html.

Step 2 – Install Dependencies

Navigate to the groceri.es directory and install dependencies using Composer. If Composer is not installed, follow this tutorial to set it up:

cd groceri.es
sudo composer install

Step 3 – Configure Apache

Create a new Apache virtual host file for Groceri.es. Use the following command to create groceri.es.conf in /etc/apache2/sites-available/:

sudo nano /etc/apache2/sites-available/groceri.es.conf

Insert the following configuration into the file:

<VirtualHost *:80>
ServerName your-domain.com
DocumentRoot /var/www/html/groceri.es/public
<Directory /var/www/html/groceri.es>
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Replace your-domain.com with your actual domain name. Save and close the file.

Enable the virtual host and disable the default configuration:

sudo a2ensite groceri.es.conf
sudo a2dissite 000-default.conf

Restart Apache to apply the changes:

sudo systemctl restart apache2

Step 4 – Configure Database

Set up a database for Groceri.es. If MySQL is not installed, refer to this guide for installation:

Log in to the MySQL server:

mysql -u root -p

Create a new database and user for Groceri.es:

CREATE DATABASE groceri_es;
CREATE USER 'groceriuser'@'localhost' IDENTIFIED BY 'your-password';
GRANT ALL PRIVILEGES ON groceri_es.* TO 'groceriuser'@'localhost';
FLUSH PRIVILEGES;

Replace your-password with your chosen password.

Update the .env file with database details:

cp .env.example .env
nano .env

Edit these lines with your database information:

DB_DATABASE=groceri_es
DB_USERNAME=groceriuser
DB_PASSWORD=your-password

Step 5 – Run Migrations

Execute the database migrations:

sudo php artisan migrate

Step 6 – Configure Storage

Create a storage link:

sudo php artisan storage:link

Set appropriate file permissions:

sudo chown -R www-data:www-data /var/www/html/groceri.es/storage
sudo chown -R www-data:www-data /var/www/html/groceri.es/bootstrap/cache

Step 7 – Access Groceri.es

Access Groceri.es via your web browser by navigating to http://your-domain.com.

The login page should appear. You can create a new account or use a demo account with:

  • Email: demo@example.com
  • Password: password

Conclusion

This tutorial has covered the installation of Groceri.es on the latest Debian release. You are now prepared to efficiently manage your grocery lists with this robust web-based tool.