Deploy to Railway
This guide will walk you through deploying your AugmentOS app to Railway, a cloud hosting platform that makes deployment simple and reliable. Instead of running your app locally with ngrok, you'll have a production-ready hosted solution.
Why Use Railway Instead of ngrok?​
Benefits of Railway hosting:
- Always Online: Your app runs 24/7 without needing your computer
- Automatic Deployments: Push code changes to GitHub and Railway deploys automatically
- Better Performance: Dedicated cloud infrastructure with better uptime than local development
- Professional URLs: Clean, professional domain names instead of random ngrok URLs
- Scalability: Easily handle more users and higher traffic
- Environment Management: Separate development and production environments
- No Local Dependencies: No need to keep ngrok running or manage local tunnels
Prerequisites​
Make sure you have:
- GitHub Account: For code repository hosting
- Railway Account: Free account at railway.com
- AugmentOS Account: For the developer console at console.AugmentOS.org
- Basic Git Knowledge: For pushing code changes
Part 1: Set Up Your Repository​
1. Create Your App Repository​
Create a new repository from the AugmentOS example app template:
Option A: Using GitHub Web Interface
- Go to the AugmentOS Cloud Example App repository
- Click the green "Use this template" dropdown in the upper right
- Select "Create a new repository"
- Choose a repository name (e.g.,
my-augmentos-app
) - Set visibility to Public or Private
- Click "Create repository"
Option B: Using GitHub CLI
gh repo create --template AugmentOS-Community/AugmentOS-Extended-Example-App my-augmentos-app
2. Clone Your Repository​
Clone your new repository locally:
git clone https://github.com/YOUR_USERNAME/my-augmentos-app
cd my-augmentos-app
Part 2: Deploy to Railway​
3. Create Railway Project​
- Go to railway.com
- Sign in with your GitHub account
- Click "Deploy a new project"
- Select "Deploy from GitHub repo"
4. Connect Your Repository​
- Select your new repository from the list
- If you don't see it, click "Configure GitHub App" to give Railway access to your repositories
- Once selected, Railway will start setting up your project
5. Get Your Public URL​
- Go to the "Settings" tab in your Railway project
- Under "Networking" > "Public Networking", click "Generate Domain"
- You'll get a URL like:
yourapp-production-fa42.up.railway.app
- Copy this URL - you'll need it for the next step
Part 3: Register Your App with AugmentOS​
6. Register in Developer Console​
- Navigate to console.AugmentOS.org
- Sign in with the same account you use for AugmentOS
- Click "Create App"
- Fill in the details:
- Package Name: Use the same package name from your environment variables
- Server URL: Enter your Railway URL (e.g.,
https://yourapp-production-fa42.up.railway.app
) - Webview URL: Enter
https://yourapp-production-fa42.up.railway.app/webview
- Click "Create App"
- Take note of the api key, as you will need it later and it won't be shown again
7. Import App Configuration​
You can now add permissions, settings, and tools to your app via the AugmentOS Developer Console. Instead of doing it manually, let's upload this example's app_config.json
file by clicking the "Import app_config.json" button under Configuration Management:
- In the developer console, scroll to the "Configuration Management" section
- Click "Import app_config.json"
- Upload the
app_config.json
file from your cloned repository - This will automatically configure:
- Permissions: Microphone access for speech recognition
- Settings: Adds a toggle for show_live_transcription
- Tools: Adds an example tool called my_tool_name
- Click "Save Changes" to apply the configuration
8. Configure Environment Variables​
- In your Railway project dashboard, click on the "Variables" tab
- Under "Suggested Variables", you'll see template variables from the
.env.example
file - Replace the placeholder values:
- PACKAGE_NAME: Change
org.yourname.appname
to your unique package name (e.g.,com.yourname.myaugmentosapp
) - AUGMENTOS_API_KEY: Replace
your_api_key_here
with your actual API key from the AugmentOS Console - PORT: Leave as
3000
- PACKAGE_NAME: Change
- Click "Add All" to save the variables
9. Deploy Your App​
- On the left side of the Railway dashboard, you'll see "Apply 3 changes"
- Click the purple "Deploy" button
- Railway will build and deploy your app (this takes 1-2 minutes)
Part 4: Test Your Deployed App​
10. Install AugmentOS​
If you haven't already:
- Download the AugmentOS app from AugmentOS.org/install
- Set up your smart glasses following the setup guide
11. Test Your App​
- Open the AugmentOS app on your phone
- Find your app in the app list and tap to start it
- Expected behavior:
- Spoken text should appear on your smart glasses display
12. Test the Webview​
- In the AugmentOS phone app, tap the gear icon next to your app name
- This opens the webview interface
- Expected behavior:
- You should see your username displayed
13. Test Settings​
- In the AugmentOS phone app, with the webview interface open, tap the gear icon in the upper right
- This opens the settings menu
- Expected behavior:
- You should see the "Show live transcription" setting
- Tapping the setting should toggle the on-screen transcriptions on and off
Part 5: Continuous Deployment​
13. Make Changes and Deploy​
Railway automatically deploys when you push changes to GitHub:
- Make a change to your app locally (e.g., modify the welcome message in
src/index.ts
) - Commit and push your changes:
git add .
git commit -m "Update welcome message"
git push origin main - Railway will automatically detect the changes and deploy within 1-2 minutes
- To see the changes, restart your app in AugmentOS:
- Tap your app in the list to stop it
- Tap again to restart it
Next Steps​
Congratulations! Your AugmentOS app is now running in the cloud. Here's what you can do next:
Explore Advanced Features​
- Events: Handle user interactions and sensor data
- Settings: Add configurable options for users
- AI Tools: Integrate with Mira AI for natural language interactions
- Webview Authentication: Build rich web interfaces
Get Help​
- Discord Community: Get help from other developers
- Railway Documentation: Learn more about Railway features
- AugmentOS Documentation: Explore the full SDK documentation
- GitHub Examples: See more example projects
Troubleshooting​
App not responding after deployment?
- Check the Railway logs for errors
- Verify your environment variables are set correctly
- Ensure your API key is valid in the developer console
Changes not appearing?
- Confirm your GitHub push was successful
- Check Railway deployment status
- Restart your app in AugmentOS after deployment completes
Webview not loading?
- Verify the webview URL is set correctly in the developer console
- Check that your Railway deployment is accessible at the public URL
- Load the webview URL directly in your browser to ensure it's accessible