Categories
Elixir

Install Elixir Phoenix Framework in Ubuntu 20.04 Focal Fossa

Here is a quick steps of Phoenix Framework installation in Ubuntu 20.04 – Focal Fossa ready for website development. In summary, the steps will install the Erlang, Elixir, Phoenix Framework and PostgreSQL.

1. Erlang and Elixir Installation
First, lets install Erlang. When the pop-up of codename appear, please input Ubuntu 20.04 Codename which is “Focal”:

sudo dpkg -i erlang-solutions_1.0_all.deb 
sudo apt-get update
sudo apt-get install erlang
sudo apt-get install elixir
sudo apt-get install git vim

2. Install Phoenix Framework + NodeJS
To install, follow steps below

mix local.hex
mix archive.install hex phx_new 1.5.1
sudo apt-get install nodejs npm
sudo apt-get install inotify-tools

3. Install and Setup PostgreSQL
To install, follow steps below

sudo apt-get install postgresql postgresql-contrib
sudo -u postgres psql
\password postgres
\q
sudo systemctl restart postgresql.service

4. Try a new project, live dashboard and upload form
I have wrote article about how to build simple upload form in Phoenix Framework store the file in local storage. Here are the quick step for you to follow

git clone https://github.com/yodiaditya/phoenix-upload-file-example.git
cd phoenix-upload-file-example
vim config/dev.exs (and edit your database configuration)
mix deps.get
mix ecto.create or mix ecto.gen,migration (create a folder to fix issues)
mix phx.server

Now you have your phoenix framework running on Ubuntu 20.04 Focal Fossa!

5 replies on “Install Elixir Phoenix Framework in Ubuntu 20.04 Focal Fossa”

dpkg: error: cannot access archive ‘erlang-solutions_1.0_all.deb’: No such file or directory

Did I miss osmething?

My mistake. I have got past that.
Now I have ** (SyntaxError) config/dev.exs:62: unexpected token: “$” (column 29, code point U+0024). The $ is there for the pattern matching at the end of the line, so how can that be wrong?

Hey Pisicuta, can you posted your config/dev.exs? Otherwise, you can try to use default config/dev.exs from any phoenix github project. My sense, there is something small typho there.

Leave a Reply

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