# Can't run remote on elixir app

**URL:** <https://community.fly.io/t/cant-run-remote-on-elixir-app/10456>\
**Category:** Questions / Help\
**Tags:** elixir\
**Created:** [January 31, 2023, 2:40pm UTC](https://community.fly.io/t/cant-run-remote-on-elixir-app/10456 "2023-01-31T14:40:10Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![pauliegatto](https://avatars.discourse-cdn.com/v4/letter/p/85f322/32.png) [@pauliegatto](https://community.fly.io/u/pauliegatto)\
**Post date:** [January 31, 2023, 2:40pm UTC](https://community.fly.io/t/cant-run-remote-on-elixir-app/10456/1 "2023-01-31T14:40:10Z")

</div>

I am deploying a non-phoenix elixir app and when I run `fly ssh console -C "app/bin/apiserver remote" `as per the [documentaiton](https://fly.io/docs/elixir/the-basics/iex-into-running-app/) I get the following:

```auto
fork/exec app/bin/apiserver: no such file or directory

```

When I ssh into my VM, I don’t see the folder `/app/bin`. Is there a release process that I missing when deploying my elixir app?

Thanks,

---

<div class="post-metadata">

**Author:** ![zachallaun](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/zachallaun/32/18078_2.png) [@zachallaun](https://community.fly.io/u/zachallaun)\
**Post date:** [January 31, 2023, 3:08pm UTC](https://community.fly.io/t/cant-run-remote-on-elixir-app/10456/2 "2023-01-31T15:08:35Z")

</div>

Can you share the Dockerfile that you’re using to build your application?

---

<div class="post-metadata">

**Author:** ![pauliegatto](https://avatars.discourse-cdn.com/v4/letter/p/85f322/32.png) [@pauliegatto](https://community.fly.io/u/pauliegatto)\
**Post date:** [January 31, 2023, 11:57pm UTC](https://community.fly.io/t/cant-run-remote-on-elixir-app/10456/3 "2023-01-31T23:57:22Z")

</div>

I don’t have a Dockerfile in my application. It is a simple Elixir app with plugcowboy.

---

<div class="post-metadata">

**Author:** ![pauliegatto](https://avatars.discourse-cdn.com/v4/letter/p/85f322/32.png) [@pauliegatto](https://community.fly.io/u/pauliegatto)\
**Post date:** [February 1, 2023, 12:29am UTC](https://community.fly.io/t/cant-run-remote-on-elixir-app/10456/4 "2023-02-01T00:29:43Z")

</div>

I figured, I needed to add `release=true` to `elixir_buildpack.config` so there could be a release but when I do  
`/workspace/_build/prod/rel/apiserver/bin/apiserver remote` I get the following:

```auto
# /workspace/_build/prod/rel/apiserver/bin/apiserver remote
Erlang/OTP 23 [erts-11.2.1] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1] [hipe]

Could not contact remote node apiserver@4ca42fd6, reason: :nodedown. Aborting...

```

---

<div class="post-metadata">

**Author:** ![ray-chen](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/ray-chen/32/9075_2.png) [@ray-chen](https://community.fly.io/u/ray-chen)\
**Post date:** [February 1, 2023, 12:40am UTC](https://community.fly.io/t/cant-run-remote-on-elixir-app/10456/5 "2023-02-01T00:40:50Z")

</div>

Since you built without a Dockerfile, try following the instructions here: [Getting Started · Fly Docs](https://fly.io/docs/elixir/getting-started/#important-ipv6-settings)

---

<div class="post-metadata">

**Author:** ![pauliegatto](https://avatars.discourse-cdn.com/v4/letter/p/85f322/32.png) [@pauliegatto](https://community.fly.io/u/pauliegatto)\
**Post date:** [February 1, 2023, 12:57am UTC](https://community.fly.io/t/cant-run-remote-on-elixir-app/10456/6 "2023-02-01T00:57:18Z")

</div>

Where would I add these environment variables?

```auto
# Appended by flyctl
ENV ECTO_IPV6 true
ENV ERL_AFLAGS "-proto_dist inet6_tcp"

```

Thanks for troubleshooting this!

---

<div class="post-metadata">

**Author:** ![nbw](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/nbw/32/1247_2.png) [@nbw](https://community.fly.io/u/nbw)\
**Post date:** [February 1, 2023, 1:23am UTC](https://community.fly.io/t/cant-run-remote-on-elixir-app/10456/7 "2023-02-01T01:23:23Z")

</div>

> [@pauliegatto](#):
>
> app/bin/apiserver remote

I’ve had times where apps I need to run something like `app/apiserver/bin/apiserver remote` instead. The easiest way to verify this is to type `ls` and look at the folders once you’ve ssh’ed into you machine.

~~💡 a tip : you can run it all in one swoop using the -C flag:~~

```auto
fly ssh console -a apiserver -C "app/apiserver/bin/apiserver remote"

```

~~the -a {{appname}} is optional here unless you have multiple apps.~~

Ignore my tip. you already knew it 😃

---

<div class="post-metadata">

**Author:** ![pauliegatto](https://avatars.discourse-cdn.com/v4/letter/p/85f322/32.png) [@pauliegatto](https://community.fly.io/u/pauliegatto)\
**Post date:** [February 1, 2023, 1:26am UTC](https://community.fly.io/t/cant-run-remote-on-elixir-app/10456/8 "2023-02-01T01:26:05Z")

</div>

@nbw  
I am running `fly ssh console -C "/workspace/_build/prod/rel/apiserver/bin/apiserver remote"` but it is still unable to connect to the node:

```auto
 fly ssh console -C "/workspace/_build/prod/rel/apiserver/bin/apiserver remote"
Update available 0.0.450 -> 0.0.451.
Run "fly version update" to upgrade.
Connecting to fdaa:1:2ea0:a7b:aa4:501:dbc3:2... complete
Erlang/OTP 23 [erts-11.2.1] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1] [hipe]

Could not contact remote node minero@fdaa:1:2ea0:a7b:aa4:501:dbc3:2, reason: :nodedown. Aborting...

``
```

---

<div class="post-metadata">

**Author:** ![nbw](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/nbw/32/1247_2.png) [@nbw](https://community.fly.io/u/nbw)\
**Post date:** [February 1, 2023, 1:48am UTC](https://community.fly.io/t/cant-run-remote-on-elixir-app/10456/9 "2023-02-01T01:48:33Z")

</div>

Take a look at this post: [Could not contact remote node reason: :nodedown. Aborting... - #7 by Mark](https://community.fly.io/t/could-not-contact-remote-node-reason-nodedown-aborting/5221/7)

There’s some notes about:

```auto
ENV ECTO_IPV6 true
ENV ERL_AFLAGS "-proto_dist inet6_tcp"

```

also some stuff about the `rel` folder ( `env.ssh.eex` file, etc), which has some release files. The Legacy docs talk about that here: [Legacy pre v1.6.3 Phoenix App · Fly Docs](https://fly.io/docs/elixir/getting-started/legacy/#generate-release-config-files)

One other thing that has helped me is to compare my project to the existing hello\_elixir repo to see what is different:

> **[GitHub - fly-apps/hello\_elixir: An example for building and deploying an...](https://github.com/fly-apps/hello_elixir)**
>
> An example for building and deploying an Elixir application to Fly using a Dockerfile - fly-apps/hello\_elixir

---

<div class="post-metadata">

**Author:** ![Mark](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/mark/32/15656_2.png) [@Mark](https://community.fly.io/u/Mark)\
**Post date:** [February 1, 2023, 2:14am UTC](https://community.fly.io/t/cant-run-remote-on-elixir-app/10456/10 "2023-02-01T02:14:20Z")

</div>

Hi @pauliegatto,

When you run `fly launch`, it should detect that you have an Elixir app and it runs `mix phx.gen.release`. This creates a Dockerfile for you. It also creates a `rel` directory in your application source code.

This is where all the config happens for what we’re talking about here. You _should_ have a Dockerfile and, unless it was customized, it creates a shell script called `server` that is executed with the `app/bin/server remote` command.

See the instructions here: [Getting Started · Fly Docs](https://fly.io/docs/elixir/getting-started/#important-ipv6-settings)

for information on the ENV settings that are automatically added to the Dockerfile for you.

---

<div class="post-metadata">

**Author:** ![pauliegatto](https://avatars.discourse-cdn.com/v4/letter/p/85f322/32.png) [@pauliegatto](https://community.fly.io/u/pauliegatto)\
**Post date:** [February 2, 2023, 2:30am UTC](https://community.fly.io/t/cant-run-remote-on-elixir-app/10456/11 "2023-02-02T02:30:16Z")

</div>

@Mark

My elixir app is not a phoenix app. So maybe that’s where all my problems stem from?

---

<div class="post-metadata">

**Author:** ![Mark](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/mark/32/15656_2.png) [@Mark](https://community.fly.io/u/Mark)\
**Post date:** [February 2, 2023, 5:29am UTC](https://community.fly.io/t/cant-run-remote-on-elixir-app/10456/12 "2023-02-02T05:29:03Z")

</div>

Ah, yes. The `fly launch` command detects a Phoenix app and does some default setup for it. I missed that it was a non-Phoenix app.

The key points are you want to generate a release and you probably want a Dockerfile to help build the app and the release.
