paste.py is a modern pastebin service written in Python using FastAPI. It allows users to share code snippets and text files through a web interface or REST API, with support for syntax highlighting, file uploads, and expiration times.
Clone the repository and navigate to project directory:
git clone https://github.com/thepiloter/paste.py.git
cd paste.pyCreate environment file from example:
cp .env.example .envThe .env.example file already contains working default values suitable for local development.
Run the application using Docker Compose:
docker-compose up -dThe first startup may take a few minutes as it downloads images and sets up the database.
Open your browser and navigate to: http://localhost:8082
The application provides:
- Web Interface: http://localhost:8082/web (paste creation form)
- API Documentation: http://localhost:8082/docs (interactive API docs)
Navigate to http://localhost:8082/web to create and share pastes through the browser interface.
Use curl or any HTTP client to interact with the REST API:
# Create a paste
curl -X POST "http://localhost:8082/api/paste" \
-H "Content-Type: application/json" \
-d '{"content": "Hello World", "extension": "txt"}'
# Upload a file
curl -X POST -F "[email protected]" http://localhost:8082/fileRun application commands using docker compose:
# Run database migrations
docker compose exec myapp pdm run migrate
# Run tests
docker compose exec myapp pdm run test# Stop containers (data persists)
docker compose stop
# Start containers
docker compose start
# Stop and remove containers
docker compose downIf you prefer to run the application directly, you'll need additional services:
- Python 3.10+ (3.11.3 recommended)
- PDM
- Running MinIO server (for file storage)
- SQLite (included with Python)
git clone https://github.com/thepiloter/paste.py.git
cd paste.py
# Configure environment
cp .env.example .env
# Edit .env to update MINIO_CLIENT_LINK and BASE_URL for your setup
# Install dependencies
pdm install
# Run database migrations
pdm run migrate
# Start the application
pdm run startThe application will be available at http://localhost:8080
Note: You'll need to run MinIO separately or update the .env file to point to an existing S3-compatible storage service.
Please read the Code of Conduct and Contributing Guidelines before contributing.
This project is licensed under the MIT License.