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

2024-08-29

How to Install Bepasty on Ubuntu Server

tutorials
img

Bepasty is an open-source pastebin service that supports file uploads and Markdown. This guide will walk you through the installation process of Bepasty on an Ubuntu Server.

Prerequisites

  • Ubuntu Server 18.04 or later
  • User with root privileges or sudo access

Step 1: Update the System

Ensure your server is up-to-date using the following command:

sudo apt update && sudo apt upgrade

Step 2: Install Required Packages

Bepasty requires Python 3 and additional libraries. Install them with:

sudo apt install python3-pip python3-dev python3-setuptools python3-virtualenv build-essential

Step 3: Create a Virtual Environment for Bepasty

Set up a virtual environment to isolate Bepasty’s dependencies from the system Python installation:

mkdir ~/bepasty cd ~/bepasty python3 -m virtualenv bepasty-env

Step 4: Activate the Virtual Environment

Activate the newly created virtual environment:

source bepasty-env/bin/activate

Step 5: Install Bepasty

Install the latest version of Bepasty with:

pip3 install bepasty[server]

Step 6: Configure Bepasty

Create a configuration file at ~/bepasty/bepasty.conf with the following content:

[beaker]
session.type = file
session.data_dir = /tmp/bepasty-session/
session.lock_dir = /tmp/bepasty-session/

[app:main]
use = egg:bepasty[server]
http = 127.0.0.1:8000
upload_dir = /path/to/upload/directory
mimetypes_path = /etc/mime.types
logging_dir = /var/log/bepasty/

Replace /path/to/upload/directory with your desired upload directory path.

Step 7: Run Bepasty

Start Bepasty using:

pserve bepasty.conf

Step 8: Access Bepasty

You can now access Bepasty at http://your-server-ip-address:8000, substituting your-server-ip-address with your server's actual IP address.

Congratulations! Bepasty is now installed and configured on your Ubuntu Server.