Org-Roam installation on Linux (Ubuntu) – guide

Introduction

It has been a wild journey to say the least, in figuring out how to install and set-up Org-Roam and it doesn't help that I'm also new to Linux. But I wanted to see what all the hype was about, especially after doing all this research to find a great tool (you can find my thoughts on this in my previous post titled "A Digitized Second Brain".

Luckily, with some help from wonderful online guides and people on discord, I've put together the steps to get Org-Roam on Doom Emacs, which may result in the easiest installation. All steps were done in Ubuntu but should be applicable to other Linux Distros as well. Nevertheless, I hope you find this guide helpful.

Emacs

Download using the following:

sudo apt-get install emacs

Doom Emacs

We are going to use Doom Emacs for this because of the easy installation of using a '+ roam' flag (steps explained below). Go ahead and clone their github repo:

git clone https://github.com/hlissner/doom-emacs ~/.emacs.d

run doom-install:

~/.emacs.d/bin/doom install

Add Emacs to your PATH

If you know what you are doing, follow the quick version. Otherwise, the detailed instructions are below.

Quick version:
inside your .bash_profile

export PATH=$PATH:~/.emacs.d/bin

Step-by-step version:

  • type cd to go to your home directory. Verify you are there by typing pwd which should print out /home/'your user name'
  • type ls -a to list all files, including hidden
  • you should see '.bashrc' in your list. You can open it with vi .bashrc. This lets you go into the .bashrc using a text editor.
  • Another way of doing this is typing in vi ~/.bashrc. The ~/ is basically shorthand for /home/'yourusername'. Doing the previous steps was the longer way.
  • use your down arrow key to move the cursor all the way down to the last line. No need to press
  • type o which adds a line below the last one. Now you will be able to edit.
  • Now you can add export PATH=$PATH:~/.emacs.d/bin by etiher copying from here and using ctrl + shift + v to paste into your file or by manually typing it in. when you paste. It shouldn't be indented or anything,
  • now to exit and save the file, press the esc key and then type :x to save and exit the file.
  • If you mess up or want to exit without saving, don't press 'enter' or anything. Press the esc button and then type :q!. Now you can repeat the steps above from vi ~/.bashrc to try again.
  • vi is a bit confusing. Here is a helpful cheatsheet for reference.
  • One more step left! You have to actually load this new path into your current secession. Meaning you have to actually activate this into the terminal that you are using. type source ~/.bashrc to do so.

By completing all of the steps above to add Doom Emacs to your path, you've ensured you can run the program from whatever directory you are currently in, whether it's your Emacs folder, music, documents, etc.

Also, this is a helpful article on understanding PATH in Linux

At this point, you can go to your Applications on your linux desktop, search for Emacs, and click on "Emacs (GUI)" which should open to Doom Emacs!

Adding Org Roam To Your Config

Now that you are entering the Emacs world, certain keyboard short cuts won't work so I've provided a basic way to get started. Here are some references you should have up next to your Emacs:

  • Survival Emacs Read this short guide before you continue or have it up side by side with you Doom Emacs Note:The rest of the setup will use commands from this guide
  • The GNU Emacs Reference card and the Doom Emacs Cheatsheet are helpful for future reference as you get started on Emacs after installation but can also be used now just in case. The "Survival Emacs" is more important to have up right now.

'init.el f' file

  • Go to "open private configuration" on the front page menu. You can also use *space* f p (one at a time, not how you hold down keys for shortcuts)
  • Go into the init.el file
  • scroll down to around line 144, until you see 'org' on a line
  • type i to enable editing and then add +roam to the org name so it reads like this: (org +roam)
  • to save: type esc to get out of editing mode. Then type C-x C-s to save which you can type y. Then type C-x C-c to quit out of Emacs.
  • You need to sync these changes. Open up the terminal and run doom sync
  • Now you can reopen Doom Emacs

'config.el' file

  • Now type spc f p to go into the config.el file
  • more importantly, you need to add the directory of your files. scroll down to around line 32 where where you will seesetq org-directory
  • Underneath it add setq org-roam-directory. Type this in instead of copy and pasting since the org-roam_directory option should come up while you are typing. If not, then you may have to fix an error from earlier
  • Add your destination the the new line you've typed For example, this is mine: (setq org-roam-directory "~/Documents/Second_brain"):

org-roam_config.png

  • You can open the command line and create a folder before you add and save this destination
  • Note: You can also add Doom themes in the config file

Test out setup

At this point you are done! You can access all of the Roam commands with spc n r. If you type these slowly, you will see how the navigation works to get to org-roam.

Conclusion

This post shows the basics of getting started but I would recommend checking out this post Own Your Second Brain to see how to add it some useful features like Bidirectional Link Auto Complete. His post was the reason I was able to come up with this guide, and followed along for most of it for my own installation. Of course, the Org-Roam website is also a good place to go next.

It's amazing how much you can really customize Emacs, everything from functionalities to asthetics. It also has a wonderful online community that is willing to help and constantly uprade Org-Roam to make it the best version of itself. Whether you are Migrating from Roam Reseach or starting fresh with the Zettelkasten method, hopefully Org-Roam is an exciting start into your documentation.

Posted in Uncategorized

Leave a Reply

Your email address will not be published. Required fields are marked *