Over the past few days I came across 静かな森 and noticed its theme Yohaku, which suits my taste perfectly. Compared with my old Astral Reverie — more feature-complete but less refined — Yohaku goes deeper on writing and is better suited to life logs and a personal space; the way it presents a record also covers the little things: daily trivia, study notes, sparks of inspiration. This was my first time touching a modern frontend project. Before that I worked mainly in PHP with vanilla CSS and JS, so deploying Yohaku threw plenty of problems at me, big and small. Hence this post — a record for future reference.
Since I already have a cloud server with a public IPv4 address, this post focuses on deploying in a Linux cloud server environment (with the BT panel). Deploying on Vercel is not covered here; if that's what you're after, look for other articles online.
References
Repositories for the related projects:
Docs, technical notes, and guides referenced in this post:
Yohaku is a closed-source project, so Innei's Yohaku repo on GitHub is private. If you need access to it, you have to sponsor the developer through GitHub Sponsors.
https://github.com/sponsors/Innei
Environment setup and requirements
The Yohaku codebase lives on GitHub. It has to be compiled and built before it can be deployed to a server, and building a Node.js project is heavy on hardware, so I chose to run it through a GitHub Actions workflow.
Registering a domain and setting up DNS
The mainstream places to register a domain these days are Tencent Cloud, Alibaba Cloud, and Baidu Cloud in China, or Cloudflare, GoDaddy, and DynaDot abroad. I'd personally recommend Cloudflare, but any registrar you like will do — it makes no difference.
Once the domain is registered, go to your registrar's DNS management page (note: with Tencent Cloud, domains are managed in DNSPod) and add the following A records, putting your server's public IP in the address field:
- @
- api
A record name is the third-level, fourth-level, or deeper subdomain of your domain. For example, if example.com has an A record pointing at 1.1.1.1, then with a record named api, the DNS server resolves api.example.com to 1.1.1.1. Note that @ stands for the domain root — a record named @ is the domain itself.
Server environment and account registration
First you need a server with public internet access and a domain of your own. On Tencent Cloud, for instance, a cloud server usually costs CNY 30 - CNY 70 a month, and a domain can cost as little as CNY 10 a year. For running a website that isn't expensive — you could even call it a bargain. Beyond those two hardware requirements, there are some hard software requirements:
- A GitHub account (sign up here)
- The following runtimes installed on the server
- Docker
- Node.js 20.11 or newer (heads-up: it cannot run in the CentOS 7 environment found on older servers)
- pnpm
- pm2
- sharp
In addition, given the features Yohaku implements, these are recommended:
-
A Clerk account(since Core 7, the relevant features are handled by built-in OAuth 2.0) - A TMDB account
For the Node.js setup on your server, you can follow these commands:
If you installed Node.js through the BT panel's Node.js manager and the terminal can't find Node.js as a result, check the install path shown in the manager and add it to your PATH.
As for Docker: Tencent Cloud's BT panel application servers usually come with Docker ready to go, and the 1Panel panel ships with it too. Run docker -v in the terminal to find out whether Docker is installed. If you get a version number back, the server has it.
If you need them, here are the terminal commands for installing Docker:
Configuring the backend
Deploying MixSpace
For this part you can find a more detailed explanation in the official docs: https://mx-space.js.org/docs/core/docker
Yohaku is a decoupled frontend/backend project that depends on the MixSpace backend, so we need to deploy MixSpace first. Docker is the simpler route; start by pulling the docker-compose.yml used to deploy the backend:
cd && mkdir -p mx-space/core && cd $_
# Pull the docker-compose.yml file
wget https://fastly.jsdelivr.net/gh/mx-space/core@master/docker-compose.yml
In docker-compose.yml, fill in the following required values under the environment field:
- JWT_SECRET=
- ALLOWED_ORIGINS=
These two fields work as follows:
JWT secret: a string no shorter than 16 and no longer than 32 characters, used to encrypt users' JWTs. Be sure to keep your key safe and never leak it.Allowed origins: the domains you allow — put the record names you configured in DNS here, separated by commas. Note that each domain must be complete and have no protocol prefix. For example:api.example.com,example.com; nothttps://api.example.com, and not justapior even@.
Start Core:
docker compose up -d
Configuring the reverse proxy
Using the BT panel as the example: open it, go to Websites, create a new site, enter api.your-domain as the domain, leave everything else alone, and click Create. Now try visiting the domain — if it says “Website created successfully”, your setup is fine.
Click Settings to the right of the new site, find SSL on the left side of the dialog, configure a certificate (a free Let's Encrypt one, for instance), and turn on HTTPS.
Then repeat the steps to create another site with your-domain as the domain.
In the Settings of your backend site, click Add reverse proxy under Reverse proxy, set Target to http://127.0.0.1:2333 and the send domain to $host, then confirm.
In the Settings of your frontend site, click Add reverse proxy under Reverse proxy, set Target to http://127.0.0.1:2323 and the send domain to $host, then confirm.
Then go to https://api.your-domain/proxy/qaqdmin to configure the backend server.
When things go wrong
If you hit any of the many things that can go wrong, my advice is to ask an AI agent.
New era, new habits — we're living through an AI boom, so when you run into a problem, ask first. AI assistants will clear up most of your questions.
I'll list only the one problem I ran into: I already had Cloudreve set up on the server, so Docker already had a container named redis. The fix was simply to give the relevant container a different name in docker-compose.yml and deploy.
Updating MixSpace
As long as the major version stays the same (11.0.6 -> 11.6.1 or 11.0.6 -> 11.0.8 — if the number before the first dot hasn't changed, it's the same major version), updating MixSpace is very simple:
- Go to the MixSpace Core deployment directory;
pullthe new version directly;- Bring the new version up.
cd ./mx-space/core
docker compose pull app
docker compose up -d app
Once you see Started, open your admin panel and run the update checks:
- The post list displays properly;
- Comments and content linked from posts display properly;
- Admin login works;
- Publish a post, then delete it, to test that publishing and deleting both work.
Deploying the Yohaku frontend
I used the GitHub Actions workflow from @Innei to pre-build and deploy.
If you have some experience, the developer's official docs cover this part:
Forking the deployment workflow repository
First, fork the deploy repo from the author's account into your own GitHub account.
On GitHub, “Fork” basically means copying someone's homework, legally. The author has written a template repository containing an automatic deployment workflow. You need to tweak a few parameters to match your server and domain, but you can't edit his code directly — so you click the Fork button and copy his entire repository, untouched, into your own GitHub account. Now the repo is yours, and you can do whatever you like with it.
- Log in to your GitHub account.
- Open the author's workflow repository: yohaku-deploy-action
- Look at the top right of the screen, find the Fork button (there's usually a small number next to it), and click it!
- A confirmation page titled “Create a new fork” appears. You don't need to change anything — scroll straight to the bottom and click the green Create fork button.
- Wait two or three seconds; once the page reloads, the repo name in the top left will read
your-username/yohaku-deploy-action.
Getting a GH_PAT
GitHub Actions is a GitHub feature too, but it has no permission to read the code in private repos under your account. So you need to set up an account API key — a Personal Access Token (PAT) — for Actions to access the repo.
On any GitHub page, click your profile picture in the top right and choose Settings at the bottom of the dropdown.
Scroll to the very bottom of that long menu on the left and click Developer settings.
In the left menu choose Personal access tokens -> then Tokens (classic).
At the top right of the page, click Generate new token -> choose Generate new token (classic). (You may be asked to enter your GitHub password to verify your identity.)
On the new token page:
- Note: anything you like, e.g.
Deploy-Shiro. - Expiration: choose
No expirationso you don't have to redo this later. - Select scopes: find
repoand tick the big checkbox next to it (that's what lets this token reach your private repos).
- Note: anything you like, e.g.
Scroll to the bottom and click the green Generate token.
The page will show a very long string of gibberish starting with ghp_. Copy it right now and save it in a local text file! It's shown only once — refresh the page and it's gone for good.
Configuring Secrets
Next, put the account API key and the other required values into the deploy repo's settings:
- Go back to the homepage of the repo you forked in step one (
your-username/yohaku-deploy-action). - Click the Settings tab at the top right of the repo.
- In the left menu, click Secrets and variables -> Actions.
- Click the green New repository secret button.
- On the form:
- Name: exactly
GH_PAT(all caps — it has to be spelled that way). - Secret: paste the long
ghp_token you saved in step two.
- Name: exactly
- Click Add secret.
Click New repository secret again for each of these:
HOST: your server's IP (e.g.1.1.1.1)USER:rootor whatever your username isPASSWORD: your server's root password (if that feels unsafe, useKEYwith an SSH key instead — just fill in one of the two; the password route is easier for beginners)PORT:22(which is what it is if you haven't changed your SSH port)BASE_URL:https://your-domainNEXT_PUBLIC_API_URL:https://api.your-domain/api/v3NEXT_PUBLIC_GATEWAY_URL:https://api.your-domain
Make sure port 22 is exposed in both the BT panel firewall and your provider's cloud server dashboard firewall.
Setting up the .env file
Create a folder named shiro under /~ on your server, then create a file named .env inside it:
cd && mkdir -p shiro && cd $_ && touch .env
Put the following in .env and fill in the blanks with the corresponding values:
The developer's official instructions say to set NEXT_PUBLIC_GATEWAY_URL=${BASE_URL} and NEXT_PUBLIC_API_URL={BASE_URL}/api/v3.
But Next.js sometimes gets confused by dynamically interpolated values like ${BASE_URL}. To deny it any chance to throw an error, I suggest hardcoding the full URLs.
1. Base URLs (hardcoding is safer)
2. Clerk authentication (the site's login)
This is a third-party service that handles logins.
- Sign up at Clerk and create an application.
- Then find these two keys in its dashboard and fill them in:
3. Other miscellaneous APIs
TMDB_API_KEY=
GH_TOKEN=ghp_xxxxxxxxxxxxxxxxx
TMDB_API_KEY: TMDB is a movie database, and Yohaku can display movie cards. If you don't want to bother with it for now, leave it empty (the movie page may have no data, but the site runs fine overall). If you do want it, apply for an API key at themoviedb.org and paste it in.GH_TOKEN: the token for displaying your GitHub activity. You can paste theghp_“master key” you generated in the previous step straight in here.
GitHub Actions
Next, go to the repo's Actions page and let GitHub Actions pre-build the project.
- Click the Actions tab at the top.
- If you see a prompt saying “I understand my workflows, go ahead and enable them”, click the green button to enable them.
- Click the workflow named Build and Deploy in the left menu.
- On the right, find the button labelled Run workflow, click it, then click the green Run workflow in the popup.
If there is no Run workflow button, open the .github/workflows/ folder, open deploy.yml, click the edit (pencil) button in the top right, then click Commit changes.
When you click Commit, the system treats it as an update to the code (it triggers a push), and Build and Deploy starts on its own.
When things go wrong
If the GitHub Actions build of Yohaku fails and the log looks like this:
then try making the following changes to deploy.yml:
This fix is my own revision, based on my reading of the error plus suggestions from an AI agent, so there may be bugs I haven't found yet. If you hit something similar, consider contacting the author or filing an issue on GitHub.
Configuring in MixSpace
Official docs for this part:
Open the Mix Space admin, go to the “Config and cloud functions” page, click the add button in the top right, and fill in the editor with the following:
- Name:
shiro - Reference:
theme - Data type:
JSON - Data (using the official sample data as a template here):
Click the button to save the configuration.
Final thoughts
Deploying Yohaku this time was, at heart, a live-fire exercise in modern CI/CD workflows. From straightening out the environment in the BT panel to deep-debugging GitHub Actions, every Error I resolved rebuilt a piece of my own knowledge system.
A successful deploy is only the first step — the real fun is in the writing and customising that follow. If you run into new “black-magic problems” while following this article, feel free to leave a comment, or go straight to the author Innei. I hope this piece gives you the key help you need when building your own personal space.
