Support #970
Install Grocy on Arch Linux
Start date:
02/14/2022
Due date:
% Done:
100%
Estimated time:
Description
This is a guide for installing Grocy with Nginx on Arch Linux.
Prepare the Environment¶
- Make sure the system is up to date:
sudo pacman -Syu
- Install a few dependencies:
sudo pacman -S git nginx
Install PHP¶
- Install php and additional required packages:
sudo pacman -S php php-fpm php-sqlite php-gd php-intl composer yarn
- Edit the php config:
sudo nano /etc/php/php.ini
- And enable the following extensions:
extension=gd extension=intl extension=sqlite3 extension=pdo_sqlite extension=iconv
- And enable the following extensions:
- Start and enable php-fpm at boot:
sudo systemctl enable php-fpm sudo systemctl start php-fpm
Install Grocy¶
- Download grocy and switch to grocy user:
sudo mkdir -p /var/www && cd /var/www sudo git clone -b release https://github.com/grocy/grocy.git chown -R http /var/www/grocy sudo su - grocy
- Install grocy:
cd /var/www/grocy composer install --no-interaction --no-dev --optimize-autoloader composer clear-cache yarn install --modules-folder public/node_modules --production yarn cache clean
- Create a new config file:
cp config-dist.php data/config.php
- Exit the grocy user:
exit
Install Nginx¶
- Start and enable nginx at boot:
systemctl enable nginx systemctl start nginx
- Create a configuration directory to make managing individual server blocks easier
mkdir /etc/nginx/conf.d
- Edit the main nginx config file:
sudo nano /etc/nginx/nginx.conf
- And strip down the config file and add the include statement at the end:
worker_processes 1; error_log /var/log/nginx-error.log; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; include /etc/nginx/conf.d/*.conf; }
- And strip down the config file and add the include statement at the end:
- Create the grocy config:
sudo nano /etc/nginx/conf.d/grocy.conf
- And add the following:
server { listen 80; server_name grocy.example.com; root /var/www/grocy/public; access_log /var/log/grocy-access.log; error_log /var/log/grocy-error.log; location / { try_files $uri /index.php; } location ~ \.php$ { fastcgi_pass unix:/run/php-fpm/php-fpm.sock; fastcgi_param SCRIPT_FILENAME /var/www/grocy/public$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_script_name; include fastcgi_params; } }
- And add the following:
- Restart nginx:
systemctl restart nginx
- Open a web browser and go to grocy.example.com
- Default username/password is admin/admin.
Resources¶
Updated by Daniel Curtis almost 3 years ago
- % Done changed from 0 to 100
- Status changed from New to In Progress
- Description updated (diff)