homebrewery icon indicating copy to clipboard operation
homebrewery copied to clipboard

[Documentation] Offline Install Instructions: Ubuntu, Debian, Raspbian

Open G-Ambatte opened this issue 3 years ago • 2 comments

Currently the project has no documentation or instructions on how to install Homebrewery on Ubuntu or Raspbian. As these are popular distributions to run on the Raspberry Pi as a cheap computer to act as a standalone server, improving the documentation in this area should reduce the barrier to entry, especially for users who want to maintain complete control over their content.

The existing FreeBSD install instructions (and possibly the Docker YAML configuration) should serve as a useful starting point.


Target OSes:

  • [x] Ubuntu
  • [ ] Debian
  • [ ] Raspbian
  • [ ] MacOS

G-Ambatte avatar Dec 16 '21 05:12 G-Ambatte

Ubuntu (x64):

After a lot of mucking about with UEFI on the machine I was trying to use, I finally got Homebrewery running on Ubuntu x64. Testing beyond getting to the expected homepage has not yet been conducted.

The terminal commands are as follows:

Package install

sudo apt update
sudo apt install git nodejs npm mongodb

Update Node to v16

Ubuntu's packaged NodeJS was only version 10, which had issues with things like optional chaining. The following commands updated it to v16 for me:

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

Clone Homebrewery & Install Node Packages

git clone https://github.com/naturalcrit/homebrewery
cd homebrewery/
npm install
npm audit fix
npm run postinstall

Set Environment Variable

A simple NODE_ENV=local only creates a Shell variable, which is not detected when the server is started. It must be promoted to an Environment variable via export.

NODE_ENV=local
export NODE_ENV

Start Homebrewery

node ./server.js

All having worked correctly, you should now receive the message server running on port:8000 and be able to navigate to the Homebrewery page at http://127.0.0.1:8000.

Potential issues:

  • When I run node server.js, I get a "Unexpected token" message about a "."??? Your version of Node is outdated, so does not support optional chaining. Update to a newer version of Node.

  • When I go to http://127.0.0.1:8000, I get a SSL error??? Your NODE_ENV environment variable is not set to local, so you are being redirected to the https page. Correct your NODE_ENV variable.

G-Ambatte avatar Dec 17 '21 00:12 G-Ambatte

Initial pass at a Ubuntu install script: https://raw.githubusercontent.com/G-Ambatte/homebrewery/addInstallDocs-%231896/install/ubuntu/install.sh

To do:

  • [x] more testing of install script
  • [x] more testing of installed Homebrewery
  • [x] ensure MongoDB is running as a service and will start at boot
  • [x] get Homebrewery running as a service and start on boot

G-Ambatte avatar Dec 17 '21 03:12 G-Ambatte