How to Install Groceri.es on Void Linux

Groceri.es is a self-hosted grocery list manager that can be installed on a variety of platforms, including Void Linux. This tutorial will guide you through the installation process of Groceri.es on your Void Linux machine.

Prerequisites

Before we begin, you need to make sure that your system meets the following requirements:

Step 1: Clone the source code of Groceri.es

First, you need to clone the latest version of the Groceri.es source code from GitHub. Open a terminal and run the following command:

git clone https://github.com/groceri-es/groceri.es.git

This will download the source code to your current directory.

Step 2: Install dependencies

Before we can proceed, we need to install some dependencies. You can do this by running the following command:

xbps-install nginx php7 php7-fpm php7-pdo_mysql mariadb

This will install all the required packages needed to run Groceri.es.

Step 3: Setup the web server

Next, we need to configure the web server to serve Groceri.es. In this tutorial, we are going to use Nginx as the web server.

Create a new server block by creating a new configuration file in /etc/nginx/conf.d directory:

sudo nano /etc/nginx/conf.d/groceri.es.conf

Paste the following configuration code into the file:

server {
        listen 80;
        server_name groceri.es;
        root /path/to/groceri.es;

        index index.php index.html;

        location / {
                try_files $uri $uri/ /index.php?$args;
        }

        location ~ .php$ {
                try_files $uri =404;
                fastcgi_pass unix:/run/php-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }
}

Replace "/path/to/groceri.es" with the physical location of where you cloned Groceri.es.

Save and close the file by pressing Ctrl+X, then Y, then Enter.

Lastly, restart the Nginx server so that the new configuration can take effect.

sudo service nginx restart

Step 4: Configure the database

The next step is to configure the database. We need to create a new MySQL/MariaDB user and database that Groceri.es will use to store its data.

First, open the MySQL/MariaDB shell by entering the following command:

mysql -u root -p

Enter your root password when prompted.

Create a new database:

CREATE DATABASE groceri_es;

Create a new user:

CREATE USER 'groceri_es_user'@'localhost' IDENTIFIED BY 'password';

Grant the new user all the necessary privileges:

GRANT ALL PRIVILEGES ON groceri_es.* TO 'groceri_es_user'@'localhost';

Flush the privileges so that the changes take effect:

FLUSH PRIVILEGES;

Exit the MySQL/MariaDB prompt by running the following command:

EXIT;

Step 5: Configure Groceri.es

Navigate to the root directory of your Groceri.es installation:

cd /path/to/groceri.es

Copy the config.sample.php file to config.php:

cp config.sample.php config.php

Open config.php in a text editor:

nano config.php

Fill in the necessary details for the database, such as the database name, username, password, and host:

define('DB_HOST', 'localhost');
define('DB_USER', 'groceri_es_user');
define('DB_PASSWORD', 'password');
define('DB_NAME', 'groceri_es');

Save and close the file.

Step 6: Install dependencies

To install the necessary dependencies, run the following command:

composer install

This will download all the required PHP dependencies that Groceri.es needs.

Step 7: Run the migration

Run the following command to migrate the database:

php artisan migrate

This will create the necessary tables in the database.

Step 8: Set appropriate file permissions

You need to ensure that the appropriate file permissions are set. You can achieve this by running the following commands:

sudo chown -R www-data:www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache

Step 9: Start the PHP-FPM service

Start the PHP-FPM service by running the following command:

sudo service php7-fpm start

Step 10: Access Groceri.es

Open a web browser and navigate to http://groceri.es (replace "groceri.es" with your server's domain name or IP address). You should now be able to access the Groceri.es application and start using it to manage your grocery list.

Congratulations, you have successfully installed Groceri.es on your Void Linux machine!

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!

Alternatively, for the best virtual desktop, try Shells!