DEV Community

loading...

Installing Forem in Linux

akhilnaidu profile image Akhil Naidu Updated on ・2 min read

This post is on the request of @benki

In this article, I focus less on my commentary and prefer more clarity in command execution. So if you find any words others than shell commands, take a good look at them.

One more tip while following this guide, single command lies in a single line.

This guide will be useful for anyone who wants to install forem in Linux. In a way, this is an alternative method to install Forem without Docker or Podman

Updating our system and Downloading Forem

sudo apt update
sudo apt upgrade
git clone https://github.com/forem/forem.git
Enter fullscreen mode Exit fullscreen mode

Ruby Installation

sudo apt install git curl autoconf bison build-essential \
    libssl-dev libyaml-dev libreadline6-dev zlib1g-dev \
    libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev
Enter fullscreen mode Exit fullscreen mode
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
exec $SHELL
Enter fullscreen mode Exit fullscreen mode
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
exec $SHELL
Enter fullscreen mode Exit fullscreen mode
rbenv install $(cat ~/forem/.ruby-version)
rbenv global $(cat ~/forem/.ruby-version)
Enter fullscreen mode Exit fullscreen mode

Install NVM and yarn

curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.35.3/install.sh -o install_nvm.sh
Enter fullscreen mode Exit fullscreen mode
bash install_nvm.sh
source ~/.profile
nvm install $(cat ~/forem/.nvmrc)
nvm use $(cat ~/forem/.nvmrc)
Enter fullscreen mode Exit fullscreen mode
npm install -g yarn
Enter fullscreen mode Exit fullscreen mode

Installing Postgre SQL

sudo apt-get install postgresql postgresql-contrib libpq-dev -y
Enter fullscreen mode Exit fullscreen mode

In the coming command, Replace the term "ubuntu" with your own username.

sudo -u postgres createuser -s ubuntu
Enter fullscreen mode Exit fullscreen mode

Installing Imagemagick

sudo apt update && sudo apt install imagemagick
Enter fullscreen mode Exit fullscreen mode

Installing and ConfiguringRedis

sudo apt install redis-server -y
Enter fullscreen mode Exit fullscreen mode
sudo nano /etc/redis/redis.conf
Enter fullscreen mode Exit fullscreen mode

Navigate to find the variable supervised and change it's value systemd

sudo systemctl restart redis.service
Enter fullscreen mode Exit fullscreen mode

Installing Elastic search

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-7.5.2-amd64.deb
Enter fullscreen mode Exit fullscreen mode
sudo dpkg -i elasticsearch-oss-7.5.2-amd64.deb
Enter fullscreen mode Exit fullscreen mode
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service
Enter fullscreen mode Exit fullscreen mode

Now we have all the required side packs for our installation

Installing and Starting Forem

sudo apt-get install libcurl4 libcurl4-openssl-dev -y
cd ~/forem
cp .env_sample .env
gem install bundler
bin/setup
bin/startup
Enter fullscreen mode Exit fullscreen mode

Discussion

pic
Editor guide
Collapse
akhilnaidu profile image