Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
run phoenix on amazon linux
# app deps
sudo yum install git
# erlang deps
sudo yum groupinstall "Development Tools"
sudo yum install ncurses-devel openssl-devel
# erlang
tar -zxvf otp_src_19.2.tar.gz
rm otp_src_19.2.tar.gz
cd otp_src_19.2/
sudo make install
cd ..
# elixir
cd elixir-1.4.2/
sudo make install
echo "PATH=\$PATH:/home/ec2-user/elixir-1.4.2/bin" >> ~/.bashrc
cd ..
# phoenix deps
sudo yum install postgresql
mix local.hex
sudo yum install nodejs npm --enablerepo=epel
sudo npm -g install brunch
# listen on port 80 as well
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 4001
git clone git://
cd my-phoenix-app
npm install
mix deps.get
MIX_ENV=prod mix ecto.create
MIX_ENV=prod mix ecto.migrate
brunch build --production
MIX_ENV=prod mix phoenix.digest
MIX_ENV=prod PORT=4001 elixir --detached -S mix do compile, phoenix.server

This comment has been minimized.

Copy link

goughjt commented Apr 12, 2017

I don't think there is a need for
sudo make install
(line 24)
after making elixir.

Suggest instead
source ~/.bash-profile
after editing bashrc (so path is updated)


This comment has been minimized.

Copy link

hakunin commented Jun 17, 2017

Thanks for the great writeup! The nodejs installed is suuuper outdated, use this instead:

sudo curl --silent --location | sudo bash -
sudo yum -y install nodejs

This comment has been minimized.

Copy link

hariharasudhan94 commented Jul 5, 2017

i am getting error like when i trying sudo make intsall on elixir

escript: exception error: undefined function rebar:main/1
in function escript:run/2
in call from escript:start/1
in call from init:start_it/1
in call from init:start_em/1
make: *** [erlang] Error 127

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.