Tokumei is an open-source, lightweight and privacy-focused blogging platform. In this tutorial, we will explain how to install Tokumei on Elementary OS.
Tokumei requires a web server, a database, and a few other dependencies to function properly.
sudo apt update
sudo apt install git curl mariadb-server mariadb-client php-fpm php-cli php-mysql php-curl nginx certbot python3-certbot-nginx
In this step, we will create a server block for Tokumei in the Nginx configuration directory.
sudo nano /etc/nginx/conf.d/tokumei.conf
server {
listen 80;
server_name your_domain.com; # Replace "your_domain.com" with your actual domain name
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name your_domain.com; # Replace "your_domain.com" with your actual domain name
# SSL Configuration
ssl_certificate /etc/letsencrypt/live/your_domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/your_domain.com/privkey.pem;
# Tokumei Location Block
location / {
root /var/www/tokumei;
try_files $uri /index.php;
}
# PHP Configuration
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; # Replace "php7.4-fpm" with your PHP version
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
# Security Configuration
add_header Referrer-Policy "no-referrer";
add_header X-Content-Type-Options "nosniff";
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
}
Save the changes and exit the editor.
Test the Nginx configuration using the following command:
sudo nginx -t
sudo systemctl reload nginx
In this step, we will create a new database and user for Tokumei to use.
sudo mariadb
CREATE DATABASE tokumei_db;
GRANT ALL PRIVILEGES ON tokumei_db.* TO 'tokumei_user'@'localhost' IDENTIFIED BY 'password';
Replace "password" with a strong and secure password for the user.
Exit the MariaDB shell using the following command:
exit
cd /var/www/
sudo git clone https://github.com/tokumei/tokumei.git
sudo cd tokumei
sudo cp settings/default.php.example settings/default.php
sudo nano settings/default.php
define('SQL_DSN', 'mysql:host=localhost;dbname=tokumei_db');
define('SQL_USER', 'tokumei_user');
define('SQL_PASSWORD', 'password'); # Replace "password" with the password you set in step 3
sudo systemctl restart php7.4-fpm # Replace "php7.4-fpm" with your PHP version
sudo chown -R www-data:www-data /var/www/tokumei
sudo chmod -R 755 /var/www/tokumei
sudo certbot --nginx -d your_domain.com # Replace "your_domain.com" with your actual domain name
Answer the prompts as needed.
You should now be able to access Tokumei by visiting your domain name in a web browser.
That's it! Tokumei should now be successfully installed on your Elementary OS system. You can start blogging and customizing your platform to meet your needs.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!