JoeZMar

JoeZMar

Problems deploying to Digital Ocean droplet running Ubuntu 16.04 from Mac

I am trying to deploy my first Phoenix app to a Digital Ocean droplet. My local machine is a Mac running Unix and the Digital Ocean droplet is Ubuntu 16.04.

I have been following this guide

I can make it all the way through step 7 where it actually deploys using edeliver and distillery. I build the release on my local machine. I can transfer the release to the production server with:

mix edeliver deploy release to production

It tells me my release was deployed to production so I run:

mix edeliver start production

which it tells me it starts. I have my app configured to port 4000 so when I visit http://example.com:4000 with example being my site domain or ip-address it refuses the connection. So I open my Ubuntu server and see if there is anything running on port 4000 using

lsof -i :4000

and there is nothing running on that port. I don’t even know where to begin to troubleshoot anymore because I’m not running into any errors going through this tutorial. I thought it might be the firewall so i added 4000 to be allowed within ufw.

I wanted to avoid using a service like Heroku or gigalixir, but I am getting ready to throw in the towel for now and just switch. Is there a decent tutorial on how to deploy without having to use Docker or Heroku?

Most Liked

NobbZ

NobbZ

You should build your release on a machine that runs the same operating system in the same version with the same library versions.

Since you said your local machine is a Mac and your remote is a Ubuntu, you should either build on the target (which I’d not recommend) or in a Ubuntu 16.04 VM on your Mac.

Most

Most

I followed that tutorial and managed to get my site up but it took me a few days to figure it out. I had a hard time because I’m not very familiar with the devops part of stuff like nginx. It also was annoying because it costs money every month even for the smallest droplet and for a hobby or new app that you are just trying to get deployed it’s not worth it in my opinion.

Either way, when it came to troubleshooting I remember there were logs being saved somewhere on the server that you should be able to pull up about your app and it’ll give you some clues. These were erlang logs I think. I wish I could be more specific but It’s been a while.

The fastest route to deployment has been heroku in my experience. But after trying to internalize the “phoenix is not your app” mantra and get a better handle on what it means to leverage OTP, it’s hard to justify using Heroku since it has to reset its dynos daily, effectively killing any long-running processes.

My most recent project I decided to try gigalixir which I have to say so far, I am thoroughly impressed. Amazing documentation. Insane customer service! You get hot code upgrades and all that stuff baked in. And the free tier is sufficient for most hobby apps.

jakemorrison

jakemorrison

Try this template: GitHub - cogini/elixir-deploy-template: An example project for deploying Elixir · GitHub
It is a step-by-step process for building and deploying a Phoenix app using Ansible.
I have been testing it on a Digital Ocean droplet with CentOS 7, Ubuntu 16.04 and 18.04.

I am preparing it as part of this guide:

Please give me your feedback / questions.

Where Next?

Popular in Questions Top

9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
vac
Hi, I’m quite new in Elixir and I’m trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and I...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
earth10
Hi, I’m just starting to build a side-project with Elixir and Phoenix and doing some basic test with Elixir alone. What strikes me is th...
New

Other popular topics Top

danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29603 241
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39467 209
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement