Appearance
Self-Hosting Ditto
Ditto is a static web application. Once built, it's just HTML, CSS, and JavaScript files that can be served from anywhere. This makes self-hosting straightforward.
Prerequisites
- Node.js 22+ (required for building)
- Bun or npm (package manager)
- A web server or static hosting service
Quick start
bash
# Clone the repository
git clone https://github.com/ectosquad/ditto.git
cd ditto
# Install dependencies
bun install
# Build
bun run build
# The built site is in dist/The dist/ directory now contains everything you need. Upload it to any web server.
Deployment options
GitHub Pages
The repository includes a GitHub Actions workflow that automatically deploys to GitHub Pages when you push to main:
- Fork the Ditto repository
- Enable GitHub Pages in your repository settings
- Push to
main - Your instance is live at
https://yourusername.github.io/ditto/
GitLab Pages
The repository also includes a .gitlab-ci.yml that builds and deploys to GitLab Pages on pushes to the default branch.
Netlify / Vercel
Just connect your fork and deploy. Ditto includes a _redirects file for SPA routing on these platforms.
VPS / Any web server
bash
# Build locally
bun run build
# Upload to your server
rsync -avz dist/ user@yourserver:/var/www/ditto/Make sure your web server serves index.html for all routes (SPA routing). For Nginx:
nginx
server {
listen 80;
server_name your-domain.com;
root /var/www/ditto;
location / {
try_files $uri $uri/ /index.html;
}
}Configuration
Create a ditto.json file in the project root before building. This file lets you customize your instance:
json
{
"theme": "dark",
"relayMetadata": {
"relays": [
{ "url": "wss://your-relay.example.com", "read": true, "write": true }
],
"updatedAt": 0
},
"blossomServers": [
"https://your-blossom.example.com/"
]
}See the Configuration guide for all available options.
TIP
The ditto.json file is in .gitignore by default, so each deployment can have its own configuration without conflicts.
Android app
Ditto includes a Capacitor project for building native Android apps:
bash
# Build the web app first
bun run build
# Sync with Capacitor
npx cap sync
# Open in Android Studio
npx cap open androidThis lets you distribute Ditto as a branded Android app for your community.
Custom branding
Beyond themes, you can customize:
- Logo -- Replace
public/logo.svgandpublic/logo.png - App name -- Update in
index.htmlandpublic/manifest.webmanifest - Default relays -- Set in
ditto.json - Upload servers -- Set your own Blossom servers in
ditto.json - OG image -- Replace
public/og-image.jpgfor social sharing previews