How to Install Groceri.es on Ubuntu Server

Groceri.es is an open source, web-based grocery management tool that can help you keep track of your grocery list, pantry items, and meal planning. In this tutorial, we will guide you on how to install Groceri.es on Ubuntu Server.

Prerequisites

Before we start with the installation, make sure that you have the following:

Step 1: Update the Server

First, you need to update your Ubuntu server to ensure that all the packages and system tools are up to date. Use the command below to update the system:

sudo apt-get update
sudo apt-get upgrade

Step 2: Install Required Packages

Groceri.es is built on PHP and PostgreSQL, so you need to install the following packages:

sudo apt-get install php7.4 php7.4-curl php7.4-dev php7.4-gd php7.4-mbstring php7.4-xml postgresql postgresql-contrib php7.4-pgsql git

Step 3: Download and Install Composer

Composer is a package manager for PHP. You need to install it on your Ubuntu server. Use the following command to download and install Composer:

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

Step 4: Clone Groceri.es Source Code

Next, you need to clone the Groceri.es source code from Github repository to your server. Use the following command:

sudo git clone https://github.com/TidalLabs/groceri.es.git /var/www/html/groceri.es

Once the source code is cloned, navigate to the Groceri.es directory:

cd /var/www/html/groceri.es

Step 5: Install Dependencies

Go to the Groceri.es directory and run the Composer command to install dependencies:

sudo composer install

Step 6: Create PostgreSQL Database

Now, you need to create a PostgreSQL database for Groceri.es. Use the following command to create a database:

sudo su postgres
psql
CREATE DATABASE groceri_es;
CREATE USER groceri_es WITH PASSWORD 'your_password';
GRANT ALL PRIVILEGES ON DATABASE groceri_es TO groceri_es;
\q
exit

Make sure to replace 'your_password' with a strong, unique password.

Step 7: Configure Groceri.es

Next, you need to configure Groceri.es by creating a configuration file. Use the following command to create a new configuration file:

sudo cp .env.example .env

Open the file to edit and change the following lines to match your database configuration:

DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=groceri_es
DB_USERNAME=groceri_es
DB_PASSWORD=your_password

Step 8: Migrate the Database

Now, you need to migrate the database by executing the following command:

sudo php artisan migrate

Step 9: Generate the Application Key

Use the following command to generate a new application key:

sudo php artisan key:generate

Step 10: Start Groceri.es

Finally, start the Groceri.es service by running the following command:

sudo php artisan serve --host=0.0.0.0 --port=80

Now, you can access Groceri.es by using your web browser to the IP address or hostname of your Ubuntu server.

Conclusion

In this tutorial, we have explained how to install Groceri.es, an open source grocery management tool on Ubuntu Server. Now, you can keep track of your grocery list more efficiently.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!