I had been trying to install Grocy in my Debian VPS1 for a week with no success. After several failed attempts, today I have finally made it.
In the beginning I followed the guide in the documentation and the guide pined in Reddit
(link), but
it did not work: some HTTP 500 Error or something like that. Then I made my own custom Nginx
server
configuration, it did not work neither. Then moved the files to different directories, changed their
ownership, installed php8.1
, etc., but nothing seemed to work.
The best result I achieved was being able to login, just to face a dashboard seeming not to recognize the CSS styling. A similar situation had been reported in Reddit a few days ago (link).
But then, out of nowhere…
Today I got the idea to be certain that the problem was in my VPS. So I installed php8.1 in my PC, downloaded
Grocy, and run the app with php -S 127.0.0.1:8000
from grocy/public
. It worked like a charm.
So I tried by first removing php
in my VPS and then installing php8.1
from scratch, and it worked! The
following are the exact steps I did:
Purge php7.4
and install php8.1
Remove the php
version currently installed, because mine was 7.4
|
|
Update and upgrade the system
|
|
Installed some other packages2 to add the php8.1
repository to the list
|
|
Then use this script to set up the php8.1
repository
|
|
Update and upgrade the system
|
|
Install php8.1
and other dependencies for Grocy
|
|
Start the php8.1
process
|
|
Download Grocy and set the Nginx server
Make the folder where Grocy is gonna live, and move to it
|
|
Download the last version of Grocy, and unpack it
|
|
Copy the config.php
file to the data
folder
|
|
Note: Normally you would edit the config.php
file as described in the documentation and in its internal
comments. In my case the Grocy instance is going to be on the subdomain grocy.website.org
of my
VPS. Therefore, I do not need to edit anything in config.php
.
Change the ownership of the files to the user and group www-data
(which should exist by default in your
system).
|
|
Edit/create the file /etc/nginx/conf.d/fastcgi_params
and fill it with the following information
|
|
Finally set the Nginx
server. In the file /etc/nginx/sites-available/grocy
write the following
|
|
Of course you must change the server_name
directives to your server.
Then create the link to the sites enabled folder
|
|
and restart Nginx
|
|
If you go to the server_name
address it should be there.
Conclusions
Following those exact steps it worked to me, and I did it twice from scratch to check it wasn’t just luck.
Finally, if you are using Certbot
to encrypt the traffic to your Nginx
server, do
|
|
Do not hesitate to contact me in case you find something wrong here, or have any question. Have in mind that I am not an expert on the subject, so anything too technical may be difficult to me.