How to install Grocy on Manjaro

Grocy is a free and open-source self-hosted alternative to commercial grocery tracking solutions, such as Evernote or OneNote. It allows you to manage your pantry, shopping list, and meal planning, among other things.

In this tutorial, we will guide you through the process of installing Grocy on Manjaro Linux.

Prerequisites

Installation process

  1. Add the necessary packages and dependencies

Open the terminal and run the following command to update the Pacman database:

sudo pacman -Syu

Then, install the required software packages and dependencies:

sudo pacman -S nginx php php-fpm php-intl php-gd sqlite
  1. Install the web server

Next, we will install the web server to serve up the Grocy files.

Run the following command to install Nginx:

sudo pacman -S nginx

After the installation, start the Nginx service by running:

sudo systemctl start nginx

To ensure that Nginx starts on boot, run:

sudo systemctl enable nginx
  1. Install PHP

To run Grocy, we need to install PHP and its dependencies.

Run the following command to install PHP and its dependencies:

sudo pacman -S php php-fpm php-intl php-gd
  1. Install SQLite

Grocy uses SQLite as its database. Install it using the following command:

sudo pacman -S sqlite
  1. Download Grocy

Download the latest version of Grocy from the official website - grocy.info/">https://grocy.info/.

Go to the downloads section and download the latest release.

Once downloaded, extract the zip file in the location where you want to host the Grocy files.

  1. Configure Grocy

Next, we need to configure the Grocy settings. Navigate to the extracted folder and copy the config-dist.php file and save it as data/config.php.

Open the data/config.php file and edit the following settings:

  1. Start PHP-FPM

Run the following command to start PHP-FPM:

sudo systemctl start php-fpm

To ensure that PHP-FPM starts on boot, run:

sudo systemctl enable php-fpm
  1. Configure Nginx

We need to configure the Nginx server to serve the Grocy files.

Create a new server block by running:

sudo nano /etc/nginx/conf.d/grocy.conf

Add the following configuration:

server {
    listen 80;
    server_name example.com;

    root /path/to/grocy/;

    index index.php;

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

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

Replace example.com with your server's domain name and /path/to/grocy/ with the path where you extracted the Grocy files.

Save and close the file.

Reload the Nginx server by running:

sudo systemctl reload nginx
  1. Access Grocy

Finally, you can access Grocy by navigating to the IP address or domain name associated with your server in your web browser.

If you followed our example configuration, you can access Grocy by navigating to http://localhost on your local machine.

You will be greeted with the Grocy login page.

Conclusion

In this tutorial, we have successfully installed Grocy on Manjaro Linux. Now, you can use this powerful tool to manage your pantry, grocery lists, and meal plans effectively.

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!