Skip to content

Deploy Phoenix App on Seenode | Phoenix Hosting & Deployment Guide

This guide explains how to deploy your existing Phoenix application on seenode.

Before you begin, ensure you have:

  • A seenode account at cloud.seenode.com
  • Git configured on your machine
  • Existing Phoenix project ready to deploy

In your config/prod.exs, ensure your endpoint is configured to listen on the port defined by an environment variable, defaulting to 80 if PORT is not set. This allows seenode to correctly route traffic to your application.

config/prod.exs
import Config
config :hello,
generators: [timestamp_type: :utc_datetime]
# Configures the endpoint
config :hello, HelloWeb.Endpoint,
url: [host: System.get_env("PHX_HOST") || "localhost", port: 80],
adapter: Bandit.PhoenixAdapter,
render_errors: [
formats: [html: HelloWeb.ErrorHTML, json: HelloWeb.ErrorJSON],
layout: false
],
pubsub_server: Hello.PubSub,
live_view: [signing_salt: "Kute9Cn2"],
http: [port: String.to_integer(System.get_env("PORT") || "80")],
server: true

Create a build.sh script to streamline deployments:

build.sh
#!/usr/bin/env bash
# exit on error
set -o errexit
# Initial setup
mix local.hex --force
mix local.rebar --force
# Install dependencies
mix deps.get --only prod
# Compile and build assets
MIX_ENV=prod mix compile
MIX_ENV=prod mix assets.build
MIX_ENV=prod mix assets.deploy

Make the script executable: chmod +x build.sh

  1. Push to Git

    Commit your project and push it to GitHub or GitLab.

  2. Create a Web Service

    From the seenode Dashboard, create a new Web Service and connect the Git repository for your Phoenix application.

    Configure Build & Start: Port field
  3. Configure Build & Start Commands

    seenode automatically detects an Elixir project. Configure the build and start commands:

    Build Command (choose one approach):

    Option A - Using build script:

    Terminal window
    ./build.sh

    Option B - Direct commands:

    Terminal window
    mix local.hex --force && mix local.rebar --force
    mix deps.get --only prod
    MIX_ENV=prod mix compile
    MIX_ENV=prod mix assets.build
    MIX_ENV=prod mix assets.deploy

    Start Command:

    Terminal window
    MIX_ENV=prod mix phx.server
  4. Configure Port and Environment Variables

    In the Configure Build & Start screen, set the Port field (above Environment Variables) to your desired value (e.g., 80 or 8080). You do not need to add a PORT environment variable. Then add any required environment variables, such as:

    • SECRET_KEY_BASE — generate locally with mix phx.gen.secret (required for production)
  5. Choose Pricing Tier

    Select your preferred instance size and click Create Web Service.

  6. Deploy

    Click Create Web Service and watch logs until your web service is live.

  7. Success

    Once complete, your Phoenix app will be live and accessible at your service’s public URL.

If you don’t have a Phoenix project yet:

Option 1: Use our Template (Recommended)

Option 2: Create from Phoenix Docs + seenode Setup

Follow the official Phoenix documentation to create a new project, then return here for seenode-specific deployment steps.

seenode-Specific Setup Steps:

  1. Install Phoenix: mix archive.install hex phx_new
  2. Create project: mix phx.new your_project
  3. Configure production settings
  4. Create build script

Now that your Phoenix app is deployed, here are some recommended next steps: