Grocy is an open-source, self-hosted solution for managing your groceries and household tasks. Here's how to install Grocy on OpenBSD.
Grocy is built with PHP, so you'll need to install PHP and PHP-FPM to run it on OpenBSD. You can do this using the pkg_add
command:
sudo pkg_add php php-fpm
Grocy requires a number of PHP extensions to function properly. You can install them with the following command:
sudo pkg_add php-pdo_mysql php-dom php-gd php-mbstring php-zip php-curl php-json php-session php-gettext
Grocy requires a database to store your data, and MariaDB is a great option. You can install it with the following command:
sudo pkg_add mariadb-server
Now you'll need to configure MariaDB. Start by creating a new database and user for Grocy:
sudo mysql -u root -p
> CREATE DATABASE grocy;
> CREATE USER 'grocy'@'localhost' IDENTIFIED BY 'password';
> GRANT ALL PRIVILEGES ON grocy.* TO 'grocy'@'localhost';
> FLUSH PRIVILEGES;
> EXIT;
Replace password
with a secure password of your choosing.
Download the latest version of Grocy from the website. Once it's downloaded, extract it to a directory of your choosing:
sudo tar xvf grocy-x.x.x.tar.gz -C /var/www/
Replace x.x.x
with the version number you downloaded.
OpenBSD uses pfctl
to manage network traffic, so you'll need to adjust the default settings for PHP-FPM. Add the following lines to your PHP-FPM configuration file:
sudo nano /etc/php-fpm.conf
security.limit_extensions = .php
listen = /var/www/run/php-fpm.sock
listen.owner = www
listen.group = www
listen.mode = 0660
Start the MariaDB and PHP-FPM services:
sudo rcctl enable mysqld
sudo rcctl set mysqld flags -u _mysql
sudo rcctl start mysqld
sudo rcctl enable php_fpm
sudo rcctl start php_fpm
Finally, navigate to http://localhost/setup
in your web browser to configure Grocy. Follow the instructions to set up your database connection and create your admin account.
That's it! You should now have a working installation of Grocy on OpenBSD.
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!