How to Install Hastebin on Ubuntu

How to Install Hastebin on Ubuntu

In this article, we are going to shows how to Install Hastebin on Ubuntu 20.04 | 18.04 . If you are interested to Install Hastebin on Ubuntu then this post is ideal for you.

Hastebin is a free and open-source pastebin software tool written in node.js, which is easily installable in any network. It can be backed by either redis or filesystem, and has a very easy adapter interface for other stores.

Major design objectives:

  • Be really pretty
  • Be really simple
  • It is easy to set up and use

Ubuntu is a Linux Operating System based on Debian and mostly composed of non-profit(free) and open-source software. It is a complete Linux operating system that compatible with desktops, laptops, server and other devices. Ubuntu is Open Source so it is freely available for both community and professional support.

if you are a learner and looking for a Linux distribution for Learning then Ubuntu Linux Operating System is best for you as a beginning.


How to Install Hastebin on Ubuntu 20.04 | 18.04

You can install Hastebin on Ubuntu using below two methods:

  • Install Hastebin From GitHub repository.
  • Install Hastebin via Snap.

Method 1 : Install Hastebin From GitHub repository

Step 1 : Update the package list

To install Hastebin, first update the default package index list in your system by running commands below:

sudo apt update
sudo apt upgrade

Step 2 : Install Required Packages

Next, you will need to install required packages by running the command below:

sudo apt install software-properties-common git

Step 3 : Install Node.JS

Hastebin is written in node.js, so you will need to install Node.js on your Ubuntu system. To do that, add its application repository by running command below:

sudo apt install curl
curl -sL https://deb.nodesource.com/setup_14.x | bash -

Next, run the command below to install node.js:

sudo apt install nodejs

Step 4 : Install Hastebin

To install Hastebin , use the git to clone the latest stable version of the haste-server repository from GitHub using command below:

git clone https://github.com/seejohnrun/haste-server.git

Next, change the directory to haste-server:

cd haste-server/

Next, run the command below from source folder to start the installation:

npm install

After that, update the dependencies and their versions by running command below:

npm update

Method 2 : Install Hastebin From via Snap

Snaps are applications packaged with all their dependencies to run on all popular Linux distributions from a single build. They update automatically and roll back gracefully.

If Snap is not installed on your system then you will need to install it before you install Hastebin. Installing via snap is the best and easiest way to install packages on Linux machine, including Ubuntu.

To Install snap package manager, run the commands below :

sudo apt update
sudo apt install snapd

Next, run the command below to install Hastebin from Snap package management:

sudo snap install haste-server --beta

Configuring Hastebin

At this point, Hastebin has been installed in your system. Now you will need to change its default 7777 port to 80.

To do that, open the  config.js file by running command below:

nano config.js

And replace the line “port”: “7777” with the “port”: “80” as show below:

"port": "80"

After the changes, save the file and close the text editor.

Next, install pm2 to manage the execution of Hastebin:

npm install pm2 -g

After install pm2, run the command below to start the execution of Hastebin:

pm2 start server.js

Save the initial configurations and make it start with the system by running command below:

pm2 save
pm2 startup

Test the Hastebin Server

To test the Hastebin server,  open your web browser and visit your server’s IP address example: http://your-server. It will open an empty page, paste your code and enjoy Hastebin.

Hastebin

That’s all

If you face any error and issue in above steps , please use comment box below to report.

If our tutorials helped you, please consider buying us a coffee. We appreciate your support!

Thank you for your support.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top