Skip to main content

Introduction

This guide covers deploying Phoenix applications on Shard Cloud. Phoenix is a web framework for Elixir that delivers fast, fault-tolerant applications with real-time capabilities.

Creating Your Project

Ensure you have Elixir and Phoenix installed.

Creating a New Phoenix Project

Basic Application Structure

Your Phoenix application should have this structure:

Configuring Port 80

Update config/runtime.exs to use port 80:
config/runtime.exs
Or configure via environment variable:
config/runtime.exs

Shard Cloud Configuration

Create a .shardcloud file:
.shardcloud
The CUSTOM_COMMAND=mix phx.server is required to start Phoenix in server mode.

Deploying

1

Verify Locally

Run mix phx.server to verify your application works locally.
2

Prepare Your Files

Ensure you have:
  • All source files (lib/, config/, priv/)
  • mix.exs
  • .shardcloud
  • assets/ folder (if using frontend assets)
3

Exclude Unnecessary Files

Remove:
  • _build/
  • deps/
  • .elixir_ls/
  • node_modules/ (if present in assets)
4

Create ZIP Archive

Zip the entire Phoenix application folder.
5

Upload to Shard Cloud

Go to Shard Cloud Dashboard and upload.

Database Configuration

If your Phoenix app uses a database, configure it in config/runtime.exs:
config/runtime.exs
Set the DATABASE_URL environment variable in your Shard Cloud dashboard.

Additional Resources

Visit the official Phoenix documentation for more information.

Troubleshooting

  • Ensure CUSTOM_COMMAND=mix phx.server is set in .shardcloud
  • Verify port 80 is configured in config/runtime.exs
  • Check that server: true is set in your endpoint config
  • Make sure mix.exs includes all required dependencies
  • Remove deps/ folder before uploading (Shard Cloud will fetch them)
  • Ensure assets/ folder is included in your ZIP
  • Run mix assets.deploy locally before uploading for production assets
  • Verify DATABASE_URL environment variable is set in dashboard
  • Check database credentials and connection string format