# Proper rails deployment steps to DirectAdmin (or any hosting not focusing in apps) hosted server?

**URL:** <https://www.ruby-forum.com/t/proper-rails-deployment-steps-to-directadmin-or-any-hosting-not-focusing-in-apps-hosted-server/236021>\
**Category:** Rails\
**Created:** [July 31, 2013, 9:57am UTC](https://www.ruby-forum.com/t/proper-rails-deployment-steps-to-directadmin-or-any-hosting-not-focusing-in-apps-hosted-server/236021 "2013-07-31T09:57:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![alcina](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a587f6/32.png) [@alcina](https://www.ruby-forum.com/u/alcina)\
**Post date:** [July 31, 2013, 9:57am UTC](https://www.ruby-forum.com/t/proper-rails-deployment-steps-to-directadmin-or-any-hosting-not-focusing-in-apps-hosted-server/236021/1 "2013-07-31T09:57:57Z")

</div>

Hi,

With PHP applications (only experience I had before), all I needed to do  
is  
to FTP all required files, create MySQL username/pass & upload SQL  
structure, add this username/pass in any given config file of the php  
script and the app worked.

Can you tell me what are standard/proper steps required to deploy an app  
that I worked on my local Ubuntu machine and want to have it working on  
‘standard’ web hosting company that does not specialize in Rails app  
hosting?

Thanks,

Rob

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [July 31, 2013, 10:07am UTC](https://www.ruby-forum.com/t/proper-rails-deployment-steps-to-directadmin-or-any-hosting-not-focusing-in-apps-hosted-server/236021/2 "2013-07-31T10:07:19Z")

</div>

On Monday, July 29, 2013 2:53:42 PM UTC+1, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,
> 
> With PHP applications (only experience I had before), all I needed to do is to  
> FTP all required files, create MySQL username/pass & upload SQL structure, add  
> this username/pass in any given config file of the php script and the app worked.
> 
> Can you tell me what are standard/proper steps required to deploy an app that I  
> worked on my local Ubuntu machine and want to have it working on ‘standard’ web  
> hosting company that does not specialize in Rails app hosting?

While there are many ways of deploying rails applications, it’s  
extremely unlikely that a non rails specialist will have  
installed/configured any of them. If you’re looking for an easy way to  
deploy a rails app, it’s hard to beat heroku for simplicity.

Fred

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [July 31, 2013, 9:27pm UTC](https://www.ruby-forum.com/t/proper-rails-deployment-steps-to-directadmin-or-any-hosting-not-focusing-in-apps-hosted-server/236021/3 "2013-07-31T21:27:52Z")

</div>

What is most popular way to deploy apps on non-Heroku machine that has  
standard Apache/MySQL setup? I would like to be able to deploy my apps  
(as  
I learn Rails) to my own dedicated machines. I have already installed  
Ruby,  
& rails gem, and I’m able to create apps on that machine without any  
issues. It is when I develop something localy when I face issue as I  
don’t  
know how to deploy it “properly”? Do I simply upload entire app folder  
structure over FTP, run bundle install, config database, and start the  
app  
OR is there a faster/easier way?

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [July 31, 2013, 9:34pm UTC](https://www.ruby-forum.com/t/proper-rails-deployment-steps-to-directadmin-or-any-hosting-not-focusing-in-apps-hosted-server/236021/4 "2013-07-31T21:34:53Z")

</div>

On Wed, Jul 31, 2013 at 12:26 PM, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> What is most popular way to deploy apps on non-Heroku machine that has  
> standard Apache/MySQL setup?

One option: [http://www.capistranorb.com/](http://www.capistranorb.com/)

–  
Hassan S. ------------------------ [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[Hassan Schroeder | about.me](http://about.me/hassanschroeder)  
twitter: @hassan

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [August 1, 2013, 3:07am UTC](https://www.ruby-forum.com/t/proper-rails-deployment-steps-to-directadmin-or-any-hosting-not-focusing-in-apps-hosted-server/236021/5 "2013-08-01T03:07:03Z")

</div>

On Jul 29, 2013, at 8:53 AM, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> With PHP applications (only experience I had before), all I needed to do is to  
> FTP all required files, create MySQL username/pass & upload SQL structure, add  
> this username/pass in any given config file of the php script and the app worked.

Yes, deploying PHP is quite simple compared to Rails.

> Can you tell me what are standard/proper steps required to deploy an app that I  
> worked on my local Ubuntu machine and want to have it working on ‘standard’ web  
> hosting company that does not specialize in Rails app hosting?

I don’t have anything written (which I should) but just googling around,  
here’s a few:

- 

> **[How to Deploy Rails Application to VPS – SUDOBITS Blog](https://blog.sudobits.com/2013/01/07/how-to-deploy-rails-application-to-vps/)**

- [http://rubysource.com/deploying-a-rails-application/](http://rubysource.com/deploying-a-rails-application/)
- 

> **[Deploying a Rails app on Nginx/Puma with Capistrano](https://tommy.chheng.com/post/123568076991/deploying-a-rails-app-on-nginxpuma-with)**
>
> Puma is a fast multi-threaded Ruby app server designed to host rack-based Ruby web apps including Sinatra and Ruby on Rails. Like Unicorn, it supports rolling restarts, but since it is multi-threaded...

There’s also a pragprog book:  
[Search](http://pragprog.com/book/cbdepra/deploying-rails) which I haven’t read.

If you hosting solution does not offer shell access, it’s going to be  
very difficult, I think to do an effective deploy. Even moreso if your  
application requires gems that need to have native extensions compiled.

There are some great Rails-hosting PaaS out there: heroku, EngineYard,  
CloudFront, etc.

My most recent job, we used AWS to host our app, and deployed using Chef  
([opscode.com](http://opscode.com)) which was really nice to work with.

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [August 1, 2013, 4:38pm UTC](https://www.ruby-forum.com/t/proper-rails-deployment-steps-to-directadmin-or-any-hosting-not-focusing-in-apps-hosted-server/236021/6 "2013-08-01T16:38:00Z")

</div>

I’ve found Nitrous really nice for testing apps somewhere in the cloud:  
[https://www.nitrous.io/join/WWm\_3k15gFU](https://www.nitrous.io/join/WWm_3k15gFU)

They encourage you to deploy apps (as others suggest) to heroku.

NB. I’ve no affiliation to Nitrious, but that link does include my  
referral  
code for more Nitrous points.

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [August 22, 2013, 6:38pm UTC](https://www.ruby-forum.com/t/proper-rails-deployment-steps-to-directadmin-or-any-hosting-not-focusing-in-apps-hosted-server/236021/7 "2013-08-22T18:38:14Z")

</div>

I have a dedicated DirectAdmin server running on CentOS and what worked  
for  
me is the following:

(Please note I make assumption you have default DA config setup with  
Apache/MySQL)

1. Install Ruby, and Rails gem
2. Install passenger: gem install passenger --pre
3. Install apache server module: passenger-install-apache2-module
4. Read the output from (3) and add necessary to your  
/etc/httpd/conf/httpd.conf. It will ask you to add few modules.
5. Create Rails app in some directory (ie. /home/SOME\_USER/rails\_app).  
This  
means: PROD config/database.yml has mysql config filled out, gem  
‘mysql2’  
is installed, bundle install, RAILS\_ENV=production bundle exec rake  
db:migrate, etc.
6. Modify respective  
/usr/local/directadmin/data/users/SOME\_USER/httpd.conf as per  
instructions  
from point (3):

- change path within \<Directory … \> to point to  
/home/SOME\_USER/rails\_app/public and add these two conditions:

AllowOverride all  
Options -MultiViews

- change DocumentRoot to point to /home/SOME\_USER/rails\_app/public

1. Restart Apache, and you are all set. You can now access your  
[domain.com](http://domain.com)  
and your app is running. Steps 1-4 are one time setup only. Steps 5-7  
when  
you want to run additional apps. Google for additional config / tuning.

Hopefully this helps,

Kamil
