Setting Up an Elixir Development Environment

Getting your development environment setup with Elixir doesn't have to be hard. Here's a quick guide to getting started.

In order to get started developing software you have to setup your development environment. This is something you will tune and personalize as you grow as an engineer, but it can be difficult to know where to get started. Here I'll showcase a brief guide to getting started on multiple platforms.

The first step on any platform is going to be to install your text editor or integrated development environment (IDE). In this case I recommend Visual Studio Code. It's a great platform to get started on that will work on any device and has great support for many languages either out of the box, or by using it's plugin system. If later you want to branch out there are many options you can try, but they're outside the scope.

Install Visual Studio Code

Installing Visual Studio Code is easy enough depending on your platform. For Mac, Windows, and Linux, it's as simple as going to the downloads page, selecting the proper version to install for you, and double clicking it.

Installing Visual Studio Code on ChromeOS

For ChromeOS it's not quite as easy, as you have to enabled Linux, but it's still totally doable for a beginner. You can follow the more in-depth guide here, but the high level overview is first you have to open Settings and look for the Linux section on the sidebar, and click Turn on the Linux support. From there you should be prompted through an install wizard. The default values should be fine for you.

Once that's completed it will open up a new terminal window for you. We'll need to run a few commands before we can proceed to installing Visual Studio Code:

sudo apt-get update
sudo apt-get install -y gnome-keyring

This installs set of helpers for your new Linux environment for managing secrets like passwords.

Next you're going to want to actually go back to the Visual Studio Code downloads page and pick the package for your Chromebook. If you're running on Intel or AMD hardware pick the 64 bit .deb file. Otherwise pick the .deb under ARM or ARM 64. You can figure out what kind of hardware you're using you can run

dpkg --print-architecture

in your terminal.

Install asdf

At this point you're ready to proceed to the next step, installing asdf, your package manager. I've written about it here before, and you can refer to their docs, but the quick version is:

git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.1

Add the following to your .bashrc (Linux) or .bash_profile (Mac):

. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash

Install Erlang and Elixir

Now that you've installed asdf it's as simple as setting up the plugins and installing the language, and then going and getting some coffee, because it's going to take a while.

asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
asdf install erlang 24.1.1
asdf install elixir 1.12.3-otp-24

Install the Visual Studio Code Plugins

The last thing on your list is going to be to install some plugins to extend the Visual Studio Code editor to improve your experience. For that I recommend the following:

With that done you're now ready to begin your Elixir development journey!