Come hang with us on Discord and chat directly with the team!Discordtop-bar-close-icon

2024-08-29

How to Install Hasty Paste on Ubuntu Server

tutorials
img

Unlock seamless code collaboration with Hasty Paste, the lightweight open-source solution for sharing snippets. Follow our step-by-step guide to set up your own Hasty Paste server on Ubuntu.

In today's fast-paced development world, sharing code snippets efficiently is crucial. Hasty Paste offers a simple yet powerful platform for developers to collaborate and exchange ideas. By hosting your own Hasty Paste server, you gain control over your data while enjoying a smooth code-sharing experience.

Before we dive in, ensure you have:

  • A server running the latest Ubuntu Server
  • Root access or sudo privileges
  • Basic familiarity with the command line

Step 1: Acquire Hasty Paste

Begin by obtaining the latest Hasty Paste package. Visit the official website or use the command line for a direct download:

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

Step 2: Unpack and Install

Extract the downloaded archive and place Hasty Paste in the appropriate directory:

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 Your Instance

Customize Hasty Paste to fit your needs. Create a configuration directory and file:

sudo mkdir /etc/hastypaste
cd /etc/hastypaste

Now, create a configuration file named hastypaste.yaml with the following content:

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

Remember to replace "your-domain.tld" with your actual domain name.

Step 4: Launch Hasty Paste

With everything in place, it's time to start your Hasty Paste server:

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

If successful, you'll see a confirmation message:

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

Congratulations! Your Hasty Paste server is now operational.

By following these steps, you've successfully set up a personal Hasty Paste instance. This allows you to share code snippets securely and efficiently, enhancing your development workflow. Remember to configure SSL for added security, ensuring your code sharing remains private and protected.

Embrace the power of self-hosting with Hasty Paste, and take control of your code-sharing environment today!