WriteFreely on VPS: Installation, Configuration, and Maintenance
Installing WriteFreely on a VPS involves deploying a Docker container, configuring a web server (Nginx or Caddy) for reverse proxy and HTTPS, and regular maintenance to ensure the stable operation of your self-hosted blogging platform. This approach provides full control over your publishing environment, ensuring high performance and flexibility, which is especially important for projects requiring maximum privacy and independence.What is WriteFreely and why install it on a VPS?
WriteFreely is a minimalist, free, and open-source blogging platform focused on simplicity, privacy, and distraction-free writing. It's designed for writers who value a clean interface, fast page loading, and the ability to focus solely on text. Unlike heavyweight CMS like WordPress, WriteFreely is not overloaded with features, plugins, and complex settings, offering an intuitive experience for both author and reader. It's an ideal solution for creating personal blogs, digital diaries, micro-blogs, or even small collective publications.Advantages of WriteFreely for content publishing
* Minimalism and simplicity: WriteFreely's interface is extremely clean, allowing the author to fully concentrate on writing. There are no unnecessary buttons, widgets, or settings that could distract. * Speed and lightness: Thanks to its lightweight nature, WriteFreely loads and operates very quickly, providing an excellent user experience. This is important for SEO and reader retention. * Federation (Fediverse): WriteFreely supports the ActivityPub protocol, allowing it to integrate with the decentralized Fediverse network. Your posts can be visible and accessible to followers on Mastodon, Pleroma, and other compatible platforms, expanding audience reach without being tied to centralized social networks. * Privacy: The platform is designed with privacy in mind. It does not collect user data, use trackers, or display ads. This makes it an excellent choice for those who value anonymity and data security. * Open Source: As an open-source project, WriteFreely provides full transparency and the ability to customize it to your needs. The community actively participates in the platform's development and support.Why choose a VPS for WriteFreely?
Choosing a VPS (Virtual Private Server) to host WriteFreely is a strategically sound decision that combines flexibility, control, and cost-effectiveness. While there are free hosting options or SaaS solutions for WriteFreely (e.g., Write.as), installing WriteFreely on a VPS gives you full sovereignty over your content and infrastructure. * **Full control:** You get root access to the server, allowing you to install any software, configure the operating system, and optimize performance to your needs. This is critical for a "writefreely self-hosted" approach. * **Flexibility and scalability:** As your blog grows or traffic increases, you can easily scale VPS resources (CPU, RAM, storage) without needing to migrate to a new server. * **Performance:** A VPS provides dedicated resources, ensuring stable and predictable performance, unlike shared hosting where resources are divided among many users. NVMe drives and modern processors offered by Valebyte.com will ensure lightning-fast WriteFreely operation. * **Security:** You are responsible for your server's security, but you also have full control over firewall settings, updates, and protection measures, allowing you to create a more secure environment than on many shared hosts. * **Cost-effectiveness:** VPS is often more cost-effective in the long run compared to expensive managed hosting or dedicated servers, especially for medium-sized projects. You only pay for the resources you use. * **Integration with other services:** On your VPS, you can easily deploy other applications or services that might complement your blog, such as an analytics system, a mail server, or even Gitea for code management. By choosing Valebyte.com, you get reliable KVM VPS with high performance, which is an ideal foundation for your self-hosted WriteFreely platform.System Requirements for WriteFreely Installation on VPS
WriteFreely is a fairly lightweight application, so its system requirements are relatively modest. However, to ensure stable operation and scalability, especially if you plan to accommodate a large number of visitors or use it for multiple users (as a Fediverse instance), it's important to choose an appropriate VPS configuration.Minimum and Recommended Configurations
For a minimal WriteFreely installation, intended for a personal blog with low traffic, the requirements will be as follows: * **CPU:** 1 vCore (e.g., Intel Xeon E3/E5 or AMD EPYC) * **RAM:** 512 MB – 1 GB * **Disk Space:** 10 GB NVMe (for the operating system, Docker, and WriteFreely data) * **Operating System:** Ubuntu 22.04 LTS, Debian 11/12, CentOS Stream 9 * **Software:** Docker, Docker Compose However, for more serious use, such as a Fediverse instance that will interact with other servers, or for a blog with anticipated moderate traffic, the following specifications are recommended: * **CPU:** 2 vCores * **RAM:** 2 GB – 4 GB (especially if you plan to run other services or use advanced features) * **Disk Space:** 25-50 GB NVMe (for storing more posts, images, and logs) * **Operating System:** Ubuntu 22.04 LTS or Debian 12 * **Software:** Docker, Docker Compose, Nginx/Caddy It's important to note that using NVMe drives significantly increases file system speed, which positively impacts the overall performance of WriteFreely, especially when working with the database and loading pages. Valebyte.com offers KVM VPS with NVMe storage, which is an optimal choice.Choosing an Operating System
WriteFreely, like most modern web applications, is designed to run on Linux servers. The most popular and well-supported distributions for deployment are: * **Ubuntu Server LTS (Long Term Support):** Versions 20.04 or 22.04 are recommended. It is one of the most common distributions, with a large community, extensive documentation, and regular security updates. * **Debian Stable:** Versions 11 (Bullseye) or 12 (Bookworm) are recommended. Known for its stability and security, making it an excellent choice for production servers. * **CentOS Stream / RHEL:** If you prefer the Red Hat ecosystem, CentOS Stream 9 or RHEL 9 will also work, but may require slightly different commands for package installation. For this article, we will use Ubuntu 22.04 LTS, as it is the most popular and convenient option for most users. Before starting the installation, ensure your VPS is updated to the latest version and has a non-root user configured with `sudo` privileges. Also, make sure you have chosen a KVM VPS, as it provides full virtualization and better compatibility with Docker compared to OpenVZ.Step-by-step WriteFreely Installation on VPS with Docker and Docker Compose
Deploying WriteFreely using Docker and Docker Compose is a modern and recommended approach that provides application isolation, simplifies dependency management, and facilitates scaling and updates. This is an excellent example of a "writefreely docker" installation.Preparing the VPS for Deployment
Before proceeding with WriteFreely installation, you need to prepare your VPS. 1. **Connect to your VPS:** Use an SSH client to connect to your server.ssh username@your_vps_ip_address
Replace `username` with your username and `your_vps_ip_address` with your VPS's IP address.
2. **Update the system:** Always start by updating the package manager and installed packages to ensure the system is up-to-date and all necessary dependencies are available.
sudo apt update
sudo apt upgrade -y
3. **Install necessary utilities:** Install `curl` and `git` if they are not already installed. These will be needed to download Docker and repositories.
sudo apt install curl git -y
4. **Configure firewall (UFW):** For enhanced security, it is recommended to configure the UFW firewall. Allow SSH, HTTP, and HTTPS traffic.
sudo ufw allow OpenSSH
sudo ufw allow http
sudo ufw allow https
sudo ufw enable
sudo ufw status
Confirm firewall activation by typing `y`.
Installing Docker and Docker Compose
To deploy WriteFreely, we will need Docker and Docker Compose. 1. **Install Docker Engine:** Use the official script to install Docker.curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
2. **Add user to Docker group:** To run Docker commands without `sudo`, add your user to the `docker` group.
sudo usermod -aG docker $USER
newgrp docker
Now, log out of your SSH session and reconnect for the changes to take effect.
3. **Verify Docker installation:** Make sure Docker is installed and running correctly.
docker run hello-world
You should see the message "Hello from Docker!".
4. **Install Docker Compose:** Docker Compose simplifies the management of multi-container Docker applications.
sudo apt install docker-compose -y
Or, if `docker-compose` is not available via `apt`, you can install it via `pip` or as a Docker plugin (recommended for newer Docker versions):
sudo apt update
sudo apt install docker-compose-plugin -y
Check Docker Compose version:
docker compose version
(Note that for the plugin, the command will be `docker compose`, not `docker-compose`).
Deploying WriteFreely via Docker Compose
Now that Docker and Docker Compose are installed, we can proceed with deploying WriteFreely. 1. **Create a directory for WriteFreely:**mkdir ~/writefreely
cd ~/writefreely
2. **Create `docker-compose.yml` file:** This file will describe the WriteFreely services configuration.
nano docker-compose.yml
Paste the following content:
version: '3.8'
services:
writefreely:
image: writefreely/writefreely:latest
container_name: writefreely
restart: always
ports:
- "8080:8080"
volumes:
- ./data:/app/data
- ./config:/app/config
environment:
- WF_CONFIG=/app/config/config.ini # Optional, if you want a custom config location
networks:
- writefreely-net
networks:
writefreely-net:
driver: bridge
* `image: writefreely/writefreely:latest`: Uses the official WriteFreely image.
* `ports: - "8080:8080"`: Maps container port 8080 to host port 8080. WriteFreely listens on 8080 by default.
* `volumes: ./data:/app/data` and `./config:/app/config`: These lines mount local `data` and `config` directories to corresponding directories inside the container. This is important for preserving data (posts, users, SQLite database) and configuration across container restarts or updates.
3. **Start WriteFreely:**
docker compose up -d
The `-d` flag runs the container in detached mode (background).
4. **Check operation:** Make sure the container is running.
docker ps
You should see `writefreely` in the list of running containers.
Now WriteFreely is accessible at `http://your_vps_ip_address:8080`.
5. **Initial WriteFreely setup:**
Navigate to `http://your_vps_ip_address:8080` in your browser. WriteFreely will prompt you to complete the initial setup.
* **Choose a host name:** Enter the domain name you plan to use (e.g., `blog.example.com`).
* **Create a new user:** Create the first administrator.
* **Allow signups:** Choose whether to allow new user registrations. For a personal blog, you can choose "No"; for a public instance, "Yes".
* **Allow federation:** If you want to integrate WriteFreely with the Fediverse, choose "Yes".
After completing the setup, you can log in to your admin panel and start publishing content.
Configuring Reverse Proxy and HTTPS for WriteFreely (Nginx/Caddy)
Direct access to WriteFreely via port 8080 is not secure or convenient for a production environment. To ensure security, use a domain name instead of an IP address, and enable HTTPS, you need to configure a reverse proxy. We will look at two popular options: Nginx and Caddy. Both servers can automatically obtain and renew SSL certificates from Let's Encrypt.Configuring Nginx as a Reverse Proxy
Nginx is a high-performance web server and reverse proxy, widely used for serving web applications. 1. **Install Nginx:**sudo apt install nginx -y
2. **Create Nginx configuration file for WriteFreely:**
sudo nano /etc/nginx/sites-available/writefreely
Paste the following content, replacing `blog.example.com` with your domain name:
server {
listen 80;
listen [::]:80;
server_name blog.example.com;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
}
}
This configuration redirects all HTTP traffic from your domain to port 8080 of the local host, where WriteFreely is running.
3. **Enable configuration:** Create a symbolic link to the file in `sites-enabled`.
sudo ln -s /etc/nginx/sites-available/writefreely /etc/nginx/sites-enabled/
4. **Test Nginx configuration and restart:**
sudo nginx -t
sudo systemctl restart nginx
5. **Install Certbot for HTTPS:** Certbot automatically obtains and installs SSL certificates from Let's Encrypt.
sudo apt install certbot python3-certbot-nginx -y
6. **Obtain SSL certificate:**
sudo certbot --nginx -d blog.example.com
Follow Certbot's instructions. It will automatically modify your Nginx configuration to enable HTTPS and set up HTTP to HTTPS redirection.
7. **Check automatic certificate renewal:**
sudo systemctl status certbot.timer
Certbot should be configured for automatic certificate renewal. You can test it:
sudo certbot renew --dry-run
Now your WriteFreely is accessible via `https://blog.example.com` with a secure connection.
Configuring Caddy for Automatic HTTPS
Caddy is a modern web server with automatic HTTPS by default. It is significantly simpler to configure than Nginx+Certbot, making it an excellent choice for "writefreely self-hosted" projects. 1. **Install Caddy:**sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy -y
2. **Create Caddy configuration file (Caddyfile):**
sudo nano /etc/caddy/Caddyfile
Remove existing content and paste the following, replacing `blog.example.com` with your domain name:
blog.example.com {
reverse_proxy localhost:8080
}
That's all! Caddy will automatically obtain an SSL certificate and configure redirection.
3. **Test Caddy configuration and restart:**
sudo caddy validate --config /etc/caddy/Caddyfile
sudo systemctl reload caddy
If validation is successful, Caddy will be running and your WriteFreely will be accessible via `https://blog.example.com`.
Caddy handles all the complexity of obtaining and renewing SSL certificates, making it ideal for those seeking simplicity in configuration.
WriteFreely Maintenance: Backups, Updates, and Security
Regular maintenance is key to the stable and secure operation of any self-hosted application. For WriteFreely on a VPS, this includes backup strategies, timely updates, and security measures. Responsibility for these processes lies with you as the owner of a self-managed VPS.WriteFreely Data Backup Strategies
WriteFreely data (posts, users, settings) is stored in the `data` directory, which we mounted as a Docker volume. This typically includes an SQLite database and any uploaded files. 1. **Stop the WriteFreely container (optional, but recommended for consistency):**cd ~/writefreely
docker compose stop writefreely
2. **Create a data archive:**
tar -czvf writefreely_backup_$(date +%Y%m%d_%H%M%S).tar.gz ./data ./config
This command will create a compressed archive with the current date and time in the filename, containing the `data` and `config` directories.
3. **Move the backup to a safe location:**
* **Locally on the VPS, but outside the WriteFreely directory:**
mv writefreely_backup_*.tar.gz /var/backups/
Ensure that `/var/backups/` exists and has the correct permissions.
* **To an external server/cloud storage (recommended):** Use `scp`, `rsync`, `sftp`, or specialized utilities to automatically upload backups to remote storage (e.g., S3, Backblaze B2, or another VPS).
scp writefreely_backup_*.tar.gz user@remote_server:/path/to/backups/
4. **Resume WriteFreely operation:**
cd ~/writefreely
docker compose start writefreely
**Automating Backups:**
You can automate this process by adding the backup command to `cron` for daily or weekly execution.
sudo crontab -e
Add a line (e.g., for a daily backup at 03:00):
0 3 * * * /bin/bash -c "cd /home/your_user/writefreely && docker compose stop writefreely && tar -czvf /var/backups/writefreely_backup_$(date +\%Y\%m\%d_\%H\%M\%S).tar.gz ./data ./config && docker compose start writefreely && find /var/backups/ -name 'writefreely_backup_*.tar.gz' -mtime +7 -delete"
This command will stop WriteFreely, create a backup, start WriteFreely, and delete backups older than 7 days. Don't forget to replace `/home/your_user/writefreely` with the actual path to your WriteFreely directory.
Updating WriteFreely and Docker Containers
Regular updates are critically important for receiving new features, bug fixes, and security patches. 1. **Update WriteFreely image:**cd ~/writefreely
docker compose pull writefreely
This command will download the latest version of the WriteFreely image.
2. **Recreate the container with the new image:**
docker compose up -d --force-recreate writefreely
`--force-recreate` ensures that the container is recreated using the new image.
3. **Update Docker Engine and Docker Compose:**
Periodically update Docker itself and Docker Compose.
sudo apt update
sudo apt upgrade -y
This will update Docker Engine and Docker Compose (if they were installed via `apt`).
Basic Security Measures for WriteFreely on VPS
* **Strong administrator password:** Use a long, complex password for your WriteFreely administrator account. * **Regular updates:** As described above, keep the OS, Docker, and WriteFreely up-to-date. * **Firewall (UFW):** Ensure UFW is configured and only allows necessary ports (SSH, HTTP, HTTPS). * **SSH keys:** Use SSH keys instead of passwords for VPS access. Disable password authentication for SSH.sudo nano /etc/ssh/sshd_config
Find `PasswordAuthentication yes` and change it to `no`. Then restart the SSH service:
sudo systemctl restart sshd
* **Fail2Ban:** Install Fail2Ban to protect against brute-force attacks on SSH and Nginx/Caddy.
sudo apt install fail2ban -y
sudo systemctl enable fail2ban
sudo systemctl start fail2ban
Configure it to monitor SSH, Nginx, and, if necessary, other service logs.
* **Log monitoring:** Regularly check system logs and WriteFreely/Docker logs for suspicious activity.
* **Access restriction:** If your WriteFreely is for personal use, consider restricting access to the admin panel by IP address through Nginx/Caddy configuration.
Which VPS config to choose for WriteFreely under real load?
Choosing the optimal VPS configuration for WriteFreely depends on the expected load, the number of concurrently active users, the volume of content, and the use of federation. WriteFreely itself is very lightweight, but background processes such as Fediverse interaction, image processing, and serving a large number of requests may require more resources.Resource Needs Assessment
* **Personal blog (1-5 authors, up to 1000 unique visitors per day):** For this scenario, WriteFreely will consume minimal resources. The main load will be on the web server (Nginx/Caddy) and the file system. * **Small collective blog/magazine (5-20 authors, 1000-5000 unique visitors per day, active federation):** This will require more RAM for caching and more CPU resources for processing requests and Fediverse background tasks. * **Large public instance (more than 20 authors, >5000 unique visitors per day, very active federation):** For this scale, several vCPUs and a significant amount of RAM may be needed, as well as high-performance NVMe storage. It's important to remember that Docker itself consumes some resources, and if you plan to run other containers on the same VPS (e.g., for analytics, backups, or other applications), this should also be taken into account. Using containers allows for efficient resource allocation but does not eliminate their basic need.Table of Recommended VPS Configurations
This table presents recommendations for choosing a VPS configuration from Valebyte.com for various WriteFreely usage scenarios. Prices are approximate and may vary.| Usage Scenario | vCPU | RAM (GB) | NVMe Disk (GB) | Approx. Price ($/month) | Comments |
|---|---|---|---|---|---|
| Personal blog (low load, 1-2 authors) | 1 | 1-2 | 25 | $5 - $10 | Ideal for beginners. Quick start, sufficient reserve for OS and WriteFreely. |
| Small collective blog (moderate load, 5-10 authors, active federation) | 2 | 2-4 | 50 | $10 - $20 | Good balance of performance and cost. Handles traffic spikes and active Fediverse. |
| Medium public instance (medium load, 10-20 authors, very active federation) | 4 | 4-8 | 100 | $20 - $40 | Ensures high responsiveness and stability with a significant number of users and intensive data exchange in the Fediverse. |
| Large public instance (high load, >20 authors, intensive federation and lots of content) | 6+ | 8+ | 200+ | $40+ | For large-scale projects requiring maximum performance and large storage volume. May be worth considering a dedicated server. |
Conclusion
Installing WriteFreely on a VPS using Docker and Docker Compose provides a powerful, flexible, and controlled environment for content publishing. This approach ensures maximum privacy, the ability to integrate with the Fediverse, and full control over your platform. For most users, a VPS with 2 vCPU, 2-4 GB RAM, and an NVMe disk, offered by Valebyte.com, will be the optimal choice, ensuring stable operation and easy scalability for your blog.Looking for a reliable server for your projects?
VPS from $10/month and dedicated servers from $9/month with NVMe, DDoS protection, and 24/7 support.
View offers →Ready to choose a server?
VPS and dedicated servers in 72+ countries with instant activation and full root access.
Get started now →