Render
Deploy your Spree application to Render.com Platform as a Service platform
Overview
Render is a Platform as a Service that makes deploying and hosting Spree applications super easy.
Spree Starter is pre-configured to work with Render out of the box. It includes render.yaml file that is used to deploy the application.
Prerequisites
- Render account - you will also need to add a credit card to your Render account to be able to deploy the application.
- GitHub account
Setup repository
Firstly create your own repository based on Spree Starter template.
Go to Spree Starter repository and click on “Use this template” button and select “Create a new repository”.
Supply the repository name and click on “Create repository from template” button.
Make sure to set your repository visibility to “Private” so no one can see your code. This is crucial for your application security.
Now clone the repository to your local machine.
Now you can start working on your application. Make sure your environment is set up correctly (follow the Getting Started guide).
Running the bin/setup
script should set your credentials correctly.
Don’t loose your config/master.key
file or share it with anyone. It’s crucial for your application to work. We recommend to add it to 1password or other password manager.
Now add your config/credentials.yml.enc
file to the repository.
Commit the changes.
This file is encrypted and cannot be seen by anyone without the master.key
file.
Don’t commit your master.key
file to the repository!
You can learn more about credentials in the Ruby on Rails Security Guide.
Create Render account and connect your repository
Go to render.com and create an account. We recommend to use your GitHub account to sign up as it will automatically link your GitHub repositories to Render.
Create Render blueprint
Render blueprints are YAML files used to deploy your application to Render. They consist a list of services that are required to run your application.
In the Render dashboard select “New blueprint” from the “+New” button.
Now select your repository from the list of repositories.
You should see the the new blueprint form.
-
Set your blueprint name - eg.
Spree App
-
Copy your
config/master.key
file to the clipboard. -
Paste it to the
RAILS_MASTER_KEY
environment variable.
After that is done click the “Deploy Blueprint” button. Now wait a few minutes for Render to setup your application.
You should see the following screen with the list of created services.
That’s it! Your application is now deployed to Render.
You can now access the admin dashboard of your application at the following URL.
The default credentials are:
We recommend changing credentials after logging in! You can also do it from the Rails console. In your Render dashboard select your web
service and click on the “Shell” tab.
Now you can open the Rails console by running bin/rails console
.
Render will automatically any new changes you push to your repository.
Next steps
Now that your application is deployed, you also need to setup asset storage as Render only provides ephemeral storage.
- Setup Asset storage (Amazon S3/Cloudflare R2)
Before going to full production, we recommend to also:
Was this page helpful?