Run Blot locally
Use this guide to set up a local Blot development environment.
1. Install Docker
You will need Docker. Ensure that Docker is installed and running on your machine before proceeding.
2. Install dnsmasq and mkcert
Blot requires a huge number of subdomains to work, for example:
https://blot.localhost
https://cdn.blot.localhost
https://site.blot.localhost
https://preview-of-blog-on-site.blot.localhost
https://preview-of-hypertext-on-site.blot.localhost
Every name under .localhost points at your own computer. Chrome, Firefox and curl know this already. Safari and programs that ask macOS (Node, for example) don’t, so we use dnsmasq to answer for .localhost too:
brew install dnsmasq
mkdir -pv $(brew --prefix)/etc/
echo 'address=/.localhost/127.0.0.1' >> $(brew --prefix)/etc/dnsmasq.conf
echo 'port=53' >> $(brew --prefix)/etc/dnsmasq.conf
sudo brew services start dnsmasq
sudo mkdir -v /etc/resolver
sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/localhost'
We use mkcert to create a locally-trusted SSL certificate. Install it, then npm start will generate and trust the certificate:
brew install mkcert nss
3. Clone the repository
Use Git to clone Blot’s source code:
git clone https://github.com/blotcms/blot --depth 1
4. Start the server
In the cloned repository, start the server:
npm start
5. Open the dashboard and example site
When the server starts it prints a dashboard login URL. You can also open:
- The dashboard: https://blot.localhost
- The example site: https://example.blot.localhost
6. Edit the example blog
The example blog uses the Local client. Its source directory is inside data, and the blog folder itself is in the local MinIO bucket:
./data/local-sources/example
7. Configure the session secret
Production deployments should set BLOT_SESSION_SECRET to a stable random value, for example, the output of:
openssl rand -hex 32
If it is not set, Blot logs a warning and uses a cryptographically secure process-local fallback. This is safe for signing, but existing dashboard sessions expire whenever the process restarts.