Ever since I started exploring alternate options to take notes, I've been constantly going back and forth between Notion and Obsidian. They're both excellent apps that offer a host of functionality apart from just taking notes. You can use them to create to-do lists, wiki pages, planners, etc. You can even map content from different notes and link them together. The possibilities are plenty. However, by default, Obsidian can only be accessed via the app. While that is fine for most people using their own devices, what if someone wants to access their Obsidian notes using a device that's not theirs? It could be a friend's phone, a public computer in a hotel, or their office laptop.

If you often find yourself in such situations, I would recommend self-hosting Obsidian. The initial setup can be slightly tricky and time-consuming if you're new to the world of self-hosting. However, once you set it up, the benefits are plenty. For starters, your data remains on-device and is, hence, safe. Moreover, you can access Obsidian using a simple web browser regardless of your location. So, if you need to access your notes and lists remotely, you no longer need to install the app. All you need is a web browser, and you're good to go. Sounds like you would benefit from it? Here's how you can self-host Obsidian to make your life easier.

Setting up Docker to self-host Obsidian

It's a one-time process

The best part about self-hosting Obsidian is that you can do it on Docker, thanks to the obsidian-remote container uploaded to GitHub. This makes the process straightforward, even if you've ever self-hosted an app before. Download Docker for your computer -- it's available for Windows, macOS, Linux, and even a Raspberry Pi. So, you could technically host it on a Raspberry Pi so that your main machine doesn't have to bear any extra load.

Once you download the app, launch it, and get the Docker Compose and Nginx Proxy Manager containers using the relevant section in the right pane. Then, use the terminal inside Docker to run the following command:

mkdir -p ob/{vaults,config}

Then, use the same terminal to execute the following script:

docker run -d \
-v ./ob/vaults:/vaults \
-v ./ob/config:/config \
-p 8080:8080 \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=America/Los_Angeles \
-e DOCKER_MODS=linuxserver/mods:universal-git \
ghcr.io/sytone/obsidian-remote:latest

Wait for the script to run. This will run the relevant container and use the latest image from the GitHub repository. Here, you can replace values such as 'TZ' with the required time zone of your choice.

Alternatively, you can also use a docker-compose.yml file for a more reusable setup. Here are the contents of the .yml file you need to create:

version: '3.8'
services:
obsidian:
image: 'ghcr.io/sytone/obsidian-remote:latest'
container_name: obsidian-remote
restart: unless-stopped
ports:
- 8080:8080
- 8443:8443
volumes:
- /home/obsidian/vaults:/vaults
- /home/obsidian/config:/config
environment:
- PUID=1000
- PGID=1000
- TZ=America/Los_Angeles
- DOCKER_MODS=linuxserver/mods:universal-git
- CUSTOM_PORT=8080
- CUSTOM_HTTPS_PORT=8443
- CUSTOM_USER=
- PASSWORD=
- SUBFOLDER=

Save the file as per the name suggested above, and then run the following command:

docker-compose up -d

Now, you have everything ready to run Docker inside your web browser.

Using Obsidian inside a browser

Everything looks and works the same

Fire up any web browser of your choice. I'm using Chrome since it's my default browser. Use the address bar to navigate to http://localhost:8080. Once you hit enter, you should see Obsidian load inside the browser window. Select whether you want to sign in with an existing account or quickly set up the app for use. While you can now access Obsidian over the browser, the repository recommends using Nginx Proxy Manager with a domain and Let’s Encrypt SSL for secure access over the internet. To do this, create yet another docker-compose.yml file with the following content:

services:
app:
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
- '80:80'
- '443:443'
- '81:81'
environment:
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt

Then, run it using:

docker compose up -d

Configure the proxy host as per the required settings, and you should be able to access Obsidian securely from anywhere using https://obsidian.yourdomain.com.

Surprisingly, everything is functional and works swiftly. The resolution of the text and the elements on the screen could have been better, but there's nothing to complain about since the core functionality is solid. This is also an excellent way to access your Obsidian notes without syncing them to any other platform, since Obsidian Sync isn't free natively.

Never lose access to your vault

Once you self-host Obsidian, you can access your vault from anywhere without worrying about downloading the app. Of course, you will also have to set up a proxy manager for additional security and ensure that you can continue to access your vault even when you're not on the same Wi-Fi network as the one on which you've hosted the service. Once you sort that out, you can continue to use all of Obsidian's features even in the web version. It's not a watered-down version of the service, so everything from plugins to updates is supported.