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
Updateconfig/runtime.exs to use port 80:
config/runtime.exs
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
Prepare Your Files
Ensure you have:
- All source files (
lib/,config/,priv/) mix.exs.shardcloudassets/folder (if using frontend assets)
Upload to Shard Cloud
Go to Shard Cloud Dashboard and upload.
Database Configuration
If your Phoenix app uses a database, configure it inconfig/runtime.exs:
config/runtime.exs
DATABASE_URL environment variable in your Shard Cloud dashboard.
Additional Resources
Visit the official Phoenix documentation for more information.Troubleshooting
Application fails to start
Application fails to start
- Ensure
CUSTOM_COMMAND=mix phx.serveris set in.shardcloud - Verify port 80 is configured in
config/runtime.exs - Check that
server: trueis set in your endpoint config
Dependencies not found
Dependencies not found
- Make sure
mix.exsincludes all required dependencies - Remove
deps/folder before uploading (Shard Cloud will fetch them)
Assets not loading
Assets not loading
- Ensure
assets/folder is included in your ZIP - Run
mix assets.deploylocally before uploading for production assets
Database connection errors
Database connection errors
- Verify
DATABASE_URLenvironment variable is set in dashboard - Check database credentials and connection string format
