How to Install Local Food Nodes on EndeavourOS Latest

Local Food Nodes is a web server application that provides a platform for local food producers to connect with consumers in their area. This tutorial will guide you through the process of installing Local Food Nodes on EndeavourOS, a Linux distribution based on Arch.

Prerequisites

Before you can start installing Local Food Nodes, you need to ensure you have the following:

Step 1: Install Required Dependencies

  1. Launch the terminal and update your system using the following command:

    sudo pacman -Syu
    
  2. Install the required dependencies:

    sudo pacman -S go postgresql nodejs npm
    

Step 2: Create a User and Database

  1. Create a new user for Local Food Nodes and set a password:

    sudo useradd -m -s /bin/bash lfuser
    sudo passwd lfuser
    
  2. Create a new database and grant the user permission to access it:

    sudo -u postgres createuser -P lfuser
    sudo -u postgres createdb -O lfuser lfdb
    

Step 3: Install Local Food Nodes

  1. Clone the Local Food Nodes repository:

    git clone https://github.com/localfoodnodes/LFN.git ~/lfn
    
  2. Navigate to the LFN directory and install the Node.js dependencies:

    cd ~/lfn
    npm install
    
  3. Build the application:

    npm run build
    

Step 4: Configuration

  1. Rename the example configuration file:

    cp .env.example .env
    
  2. Edit the configuration file and configure the following:

    DB_DRIVER=postgres
    DB_HOST=localhost
    DB_PORT=5432
    DB_USERNAME=lfuser
    DB_PASSWORD=<INSERT THE PASSWORD YOU CREATED>
    DB_DATABASE=lfdb
    
  3. Modify your Apache virtual host configuration to include the following:

    ProxyPass /api/ http://localhost:5000/api/
    ProxyPassReverse /api/ http://localhost:5000/api/
    
    ProxyPass / http://localhost:3000/
    ProxyPassReverse / http://localhost:3000/
    

Step 5: Run Local Food Nodes

  1. Start the Node.js server:

    npm run start:server
    
  2. In a separate terminal, start the React front-end:

    npm run start:client
    

Conclusion

With the installation complete, you can now access Local Food Nodes by navigating to your server's IP address in your web browser. The first time you visit the site, you will be prompted to create a new user account.

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!