Deploy an App with Database
Build a web application that connects to MySQL and deploy it as a fully hosted service on Open Source Cloud — all through natural language.
What You'll Learn
Prerequisites
- Completed the Getting Started tutorial
- Claude Code connected to OSC via MCP
- A GitHub account
Step-by-Step Guide
Create a MySQL Database
Start by asking Claude to create a MySQL database for your application:
> Create a MySQL database for my web applicationClaude will provision a MySQL instance and provide you with connection details. Make note of the host, port, username, and password.
Tip: If you already created a MySQL database in the previous tutorial, you can use that one instead.
Develop Your Application
Ask Claude to help you create a simple web application. For example, a Node.js app with Express:
> Create a simple Node.js Express app with a health endpoint and a /items endpoint that reads from the MySQL database. Use the connection details from the database you just created.Claude will generate the application code including:
- Express server setup
- MySQL connection configuration
- API endpoints
- A Dockerfile for containerization
Push to GitHub
Your application needs to be in a GitHub repository for OSC to deploy it. Ask Claude to help:
> Initialize a git repo and push this to GitHubClaude will create the repository and push your code. Make note of the repository URL.
Important: Make sure your database credentials are stored as environment variables, not hardcoded in your source code.
Deploy to OSC
Now deploy your application to Open Source Cloud:
> Deploy my application from GitHub to OSC. The repo is at [your-repo-url]. Set the MySQL connection details as environment variables.Claude will use the OSC app hosting service to:
- Pull your code from GitHub
- Build the Docker container
- Configure environment variables
- Deploy and start the application
Test Your Deployed App
Once deployed, Claude will provide you with a public URL for your application. Test it by visiting the health endpoint:
> What's the URL for my deployed application?You can also ask Claude to test the endpoints for you:
> Test the /health and /items endpoints on my deployed appSuccess! Your application is now running in the cloud, connected to your MySQL database.
Your App is Live!
You've successfully deployed a web application with a MySQL database to Open Source Cloud. Your app is now accessible via a public URL and can scale as needed.
What's Next?
Add More Services
Enhance your app with Redis caching, object storage, or other services from OSC.
> Add Redis caching to my appSet Up Custom Domain
Configure a custom domain for your deployed application.
> Set up a custom domain for my appExplore More
Discover other tutorials or browse the full documentation to unlock more possibilities with Open Source Cloud.