0xNotes is a free and open-source, privacy-focused, end-to-end encrypted note-taking web app built with Next.js and Python.
- Formatted text support: Bold, italic, underline, add images, embed youtube, and more...
- End-to-end encryption: Each note is encrypted locally with AES-CTR-256, currently one of the most secure encryption. The encryption key is derived from your username and password and stored locally on your browser. This means, hackers need to try 2^256 combinations to read your notes.
- Two-factor authentication: Secure your account by enabling Google Authenticator. You will be required to enter a 6-digit code every time you log in.
This tutorial is only for advanced users that want to self host 0xNotes. You'll need a web host that supports Next.js and a server that can run docker. HTTPS connection is highly recommended, but the frontend MUST USE HTTPS.
- Create a PostgreSQL database.
- Manually create tables:
CREATE TABLE notes (
id bigserial primary key not null,
author text,
modified timestamp with time zone not null default now(),
note text,
notes_nonce text,
server_nonce text,
title text,
title_nonce text,
type text
);
CREATE TABLE users (
id bigserial primary key not null,
username text,
auth text,
totp text
);
- Clone and switch to the
server
branch of this repo. - Create a docker image by using
docker build -t 0xnotes:latest .
. - Create a
docker-compose.yml
file using the following template, add configuration for reverse proxy (NGINX or Traefik) if required.
version: "3.3"
services:
notes:
image: 0xnotes
restart: always
container_name: 0xnotes
ports:
- "5000:5000"
networks:
- web
environment:
- "POSTGRES_URL={POSTGRES_URL}"
- "SERVER_SECRET={SECRET_RANDOM_STRING}"
- "SERVER_SALT={SECRET_RANDOM_STRING}"
networks:
web:
external: true
- Run the docker image using
docker-compose up -d
- Deploy the
main
branch of this repo to Vercel, Netlify, or Cloudflare Pages. - Create an environment variable
NEXT_PUBLIC_0XNOTES_HOST={API_HOST}
, whereAPI_HOST
is the URL of your API server. Example:NEXT_PUBLIC_0XNOTES_HOST=https://0xnotesapi.brianthe.dev/
.