How to Install Hasty Paste on Ubuntu Server Latest

Hasty Paste is a lightweight open-source paste server that allows users to easily paste and share code snippets online. In this tutorial, we will show you how to install Hasty Paste on Ubuntu Server Latest.

Prerequisites

Before we begin, ensure that you have the following:

Step 1: Download Hasty Paste

Firstly, navigate to the Hasty Paste website on https://enchantedcode.co.uk/hasty-paste/ and select the link to download the latest distribution of Hasty Paste.

Alternatively, use the following command to download the Hasty Paste package directly:

wget https://github.com/majek/hasty-paste/releases/download/v0.0.7/hasty-paste-linux-amd64-0.0.7.tar.gz

Step 2: Install Hasty Paste

Next, extract the downloaded archive file and install the Hasty Paste by running the following commands:

tar xvfz hasty-paste-linux-amd64-0.0.7.tar.gz
cd hasty-paste-linux-amd64-0.0.7
sudo cp hasty-paste /usr/local/bin/
sudo chmod +x /usr/local/bin/hasty-paste

Step 3: Configure Hasty Paste

Once Hasty Paste is installed, configure it to customize the port and domain settings, and to ensure Hasty Paste starts automatically on startup.

Firstly, create a directory for Hasty Paste settings:

sudo mkdir /etc/hastypaste

Navigate to the directory:

cd /etc/hastypaste

Create a configuration file named hastypaste.yaml and add the following code:

production:
  domain: "your-domain.tld"
  port: 8080
  mysql:
    dsn: "root:mysqlpassword@tcp(localhost:3306)/hastypaste?charset=utf8mb4&parseTime=True&loc=Local"

Note, you should replace "your-domain.tld" with your domain name.

Step 4: Run Hasty Paste

Finally, run Hasty Paste using the command:

sudo hasty-paste start --config /etc/hastypaste/hastypaste.yaml

You should see the following output if Hasty Paste is running correctly:

Hasty Paste started at http://your-domain.tld:8080

Conclusion

Now that you've installed Hasty Paste on Ubuntu Server Latest, you can easily paste and share code snippets online. You can also use SSL to secure your server and prevent unauthorized access.

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!