Railshoster Alchemy deployment

RailsHoster offers durable rails hosting for good money. In this guide you will learn how to deploy your Alchemy Site on your RailsHoster server. Please be sure that you have read the Getting Started Guide to be familar with the Alchemy installation steps. After finishing this guide you will know:

  • How to initialize your local Alchemy installation so it is ready to be deployed on RailsHoster
  • How to deploy changes you’ve made to your server

1 Prerequisites

We assume that you already have ordered a hostingplan on RailsHoster.

If not please go to railshoster.com and choose a plan that suites your needs.

Alchemy runs with all plans, even the smallest one starting a only € 4,95.

2 Install the railshoster gem


$ gem install railshoster

3 Create a remote git repo

Create a new repository on GitHub or, if you have one, into your own Gitolite/Gitosis server or where ever you have your git remote repositories.

DO NOT EVER STORE ANY CRITICAL INFORMATIONS, LIKE DATABASE OR SSH PASSWORDS INTO YOUR GIT REPOSITORY, UNLESS YOU HAVE A PRIVATE ONE!
Remember: GitHub repositories from the free plan are open to the public.

3.1 Init your project as git repository

Inside your projects folder enter:


git init .

Open the .gitignore file in your editor and add:


index/**/*
uploads/**/*

You can pass --scm=git option to the Alchemy installer while creating a new project. That option inits your project as git repository and sets all ignores for you.

3.2 Add the remote repository

3.2.1 GitHub Example

git remote add origin git@github.com:repository-name.git
3.2.2 Repository server with a non standard ssh port

git remote add origin ssh://git@your-reposerver.de:SSHPORT/repository-name.git

4 Initialize your project for railshoster


railshoster init -a YOUR_APP_KEY .

You received your app key for your rails app with your order confirmation from railshoster.

5 Add Alchemy and Rails 3.1 deploy tasks

Open the config/deploy.rb file with an editor and add:


require 'alchemy/capistrano'
load 'deploy/assets'

5.1 If your repository server has a non standard ssh port

Change


set :repository, "git@your-reposerver.de/repository-name.git"

to


set :repository, "ssh://git@your-reposerver.de:SSHPORT/repository-name.git"

6 Commit and push deploy settings


$ git commit -am 'Added deploy settings'
$ git push origin master

7 Run the setup task


railshoster deploy:setup

If prompted, enter the mount point of Alchemy to the same you have in your config/routes.rb file.

8 Make your first cold deploy


railshoster deploy:cold

Sometimes the ssh-key forwarding does not work. If the deploy script wants you to enter a password for the repository server then something is wrong with the key forwarding. RailsHoster has a guide how to fix this in their knowledge base.

9 Check the installation

Open a browser and enter the domain the railshoster gem just showed you after succesfull deploy.

You can always get your domain via the railshoster gem. Just run railshoster appurl while in your sites folder.

10 Next steps

Now you can start to customize your Alchemy site.

Just follow one of our guides.

Everytime you have made a change you want to publish onto your server just run:


railshoster deploy