How to Install FoodSoft on AlmaLinux, Rocky Linux, Debian, and Ubuntu

FoodSoft is an open-source software for managing food delivery services, primarily designed for cafeteria and restaurant management. This guide will walk you through installing FoodSoft on AlmaLinux, Rocky Linux, Debian, and Ubuntu.


Prerequisites:

Before starting the installation, ensure the following:

  • A server running AlmaLinux, Rocky Linux, Debian, or Ubuntu.
  • Root or sudo access to your server.
  • Ruby, PostgreSQL, and other dependencies installed.
  • A domain or subdomain pointing to your server.

Step 1: Update the System

Make sure all system packages are up-to-date.

  • For Ubuntu/Debian:
 
sudo apt update && sudo apt upgrade -y
  • For AlmaLinux/Rocky Linux:
 
sudo dnf update -y

Step 2: Install Required Software

FoodSoft requires Ruby, PostgreSQL, and several other dependencies. Let’s install them.

  1. Install Ruby and required packages:
  • For Ubuntu/Debian:
 
sudo apt install ruby ruby-dev libpq-dev build-essential libxml2-dev libxslt1-dev zlib1g-dev git -y
  • For AlmaLinux/Rocky Linux:
 
sudo dnf install ruby ruby-devel libpq-devel gcc libxml2-devel libxslt-devel zlib-devel git -y
  1. Install PostgreSQL (FoodSoft uses PostgreSQL for its database):
  • For Ubuntu/Debian:
 
sudo apt install postgresql postgresql-contrib -y
  • For AlmaLinux/Rocky Linux:
 
sudo dnf install postgresql-server postgresql-contrib -y

Step 3: Configure PostgreSQL Database

  1. Start PostgreSQL and log into the PostgreSQL shell:
 
sudo systemctl start postgresql sudo -u postgres psql
  1. Create a PostgreSQL user and database for FoodSoft:
sql
 
CREATE USER foodsoft WITH PASSWORD 'your_password'; CREATE DATABASE foodsoft_production OWNER foodsoft; \q

Step 4: Install FoodSoft

  1. Clone the FoodSoft repository from GitHub:
 
cd /opt sudo git clone https://github.com/foodsoft/foodsoft.git cd foodsoft
  1. Install FoodSoft dependencies using Bundler:
 
sudo gem install bundler bundle install

Step 5: Configure FoodSoft

  1. the example configuration files:
 
cp config/database.yml.example config/database.yml cp config/secrets.yml.example config/secrets.yml
  1. the database configuration:
 
sudo nano config/database.yml

Update the database settings to reflect the PostgreSQL username and password you created earlier:

yaml
 
production: adapter: postgresql database: foodsoft_production username: foodsoft password: your_password host: localhost

Step 6: Set Up the Database

  1. Run the database migrations:
 
RAILS_ENV=production rake db:create db:migrate
  1. Precompile assets:
 
RAILS_ENV=production rake assets:precompile

Step 7: Start FoodSoft

  1. Start the FoodSoft server:
 
RAILS_ENV=production rails server -b 0.0.0.0

FoodSoft should now be running on port 3000 by default. You can access it via http://yourdomain.com:3000.


Step 8: Set Up FoodSoft to Start on Boot (Optional)

  1. Create a systemd service file for FoodSoft:
 
sudo nano /etc/systemd/system/foodsoft.service
  1. Add the following content:
ini
 
[Unit] Description=FoodSoft After=network.target [Service] Type=simple User=foodsoft WorkingDirectory=/opt/foodsoft ExecStart=/usr/local/bin/bundle exec rails server -b 0.0.0.0 Restart=always [Install] WantedBy=multi-user.target
  1. Enable and start the FoodSoft service:
 
sudo systemctl enable foodsoft sudo systemctl start foodsoft

Step 9: Access FoodSoft in the Browser

Open your browser and visit http://yourdomain.com:3000. You should now be able to access the FoodSoft web interface.


Step 10: Secure the Application with SSL (Optional)

For production environments, it is recommended to secure FoodSoft with SSL. You can use Let’s Encrypt to obtain a free SSL certificate.

  1. Install Certbot:
  • For Ubuntu/Debian:
 
sudo apt install certbot python3-certbot-nginx -y
  • For AlmaLinux/Rocky Linux:
 
sudo dnf install certbot python3-certbot-nginx -y
  1. Obtain an SSL certificate:
 
sudo certbot --nginx -d yourdomain.com
  1. Restart NGINX to apply the SSL configuration.

Conclusion

You have successfully installed FoodSoft on your AlmaLinux, Rocky Linux, Debian, or Ubuntu server. You can now manage your food delivery or cafeteria services with ease.

Was this answer helpful? 0 Users Found This Useful (0 Votes)

Powered by WHMCompleteSolution