Deploying on the Rails Server

Learn to deploy your template project and how to use the rails server.

We'll cover the following

Coming online

In the previous lesson, you used rails new to create a new project, and now you already have an application that you can run. You will use a Rails script to run the Puma web-server to deploy our application.

To do this, simply cd into the project folder and run the following command:

rails server

You can also use the shorthand version of this command to deploy the server:

rails s

In our case, we will be running the server with an additional parameter, so we will use the following command:

rails s -b 'ssl://0.0.0.0:3000?key=/project/server.key&cert=/project/server.crt'

This will bind the server to 0.0.0.0, which basically means, “listen on every available network interface.” Additionally, the application will be running over HTTPS rather than on HTTP.

Click the RUN button below to deploy the application and then follow the link:

Get hands-on with 1400+ tech skills courses.