You have a number of options when installing Diaspora on Ubuntu - these include doing so manually or installing through Cloud 66 EasyDeploy.
Depending on your configuration, a manual installation of Diaspora can take up to a few days. Deploying through Cloud 66 on the other hand takes up to an hour for the initial deploy, and up to five minutes for subsequent deployments.
This post will take you through each option.
Option 1: Deploying with Cloud 66
Deploying with Cloud 66 consists of four simple steps:
1. Create an account on Cloud 66.
2. Click here to auto-fill your new stack page.
3. Next, choose where you’d like to deploy Diaspora, the region and server size. You can also choose if you’d like to deploy to separate web and database servers.
4. Once you’re happy with your configuration, simply click ‘deploy’, and sit back and relax while we deploy Diaspora for you.
Option 2: Manual Installation
For running an average-sized pod, your server should have at the very least 512MB of RAM (+1GB swap space) and a decent multi-core CPU. The amount of hard disk space required largely depends on how many images you expect your users to upload. If you plan to run the database server on the same host you should allow for at least double the amount of RAM and disk space.
- Build tools - for compiling source packages
- Ruby - the Ruby programming language
- RubyGems - package manager for Ruby code libraries (like CPAN for Perl or PEAR for PHP)
- Bundler - gem management tool for Ruby projects
- MySQL - backend storage engine
- OpenSSL - encryption library.
- libcurl - multiprotocol file transfer library
- ImageMagick - image processing library
- Git - version control system
- Redis - persistent key-value store
2. Prepare the System
sudo apt-get update sudo apt-get install build-essential git imagemagick libmagickwand-dev nodejs redis-server libcurl4-openssl-dev libxml2-dev libxslt-dev libmysqlclient-dev
There is a bug in curl below version 7.32 which is shipped in Ubuntu versions below Saucy. You can use a PPA to update curl to a newer version as follows;
sudo apt-add-repository ppa:jaywink/curldebian sudo apt-get update && sudo apt-get upgrade
Install the database
Skip this step if you already have one.
See the Ubuntu server guide.
Creating a user for Diaspora
sudo adduser diaspora sudo -i -u diaspora
The rest of the guide should happen under this user!
Removing packaged version of RVM
If you installed RVM via the package manager, we recommend to remove it. See this StackOverflow answer for some tips on how to do that and then continue with the installation instructions below.
We recommend using Ruby Version Manager it will ensure you’re always on the currently recommended Ruby version and cleanly separate your Diaspora installation from all other Ruby applications on your machine. If you opt for not using it ensure your Ruby version is at least 1.9.2-p320, prior versions are incompatible. Be aware that his version is not maintained with security updates from the Ruby core team anymore. We do not support Ruby 2.0 yet. We currently recommend using 1.9.3-p448.
As the user you want to run Diaspora under, that is not as root run:
curl -L dspr.tk/1t | bash
and follow the instructions.
Set up RVM
Ensure the following line is in your ~/.bashrc:
[[ -s “~/.rvm/scripts/rvm” ]] && source “~/.rvm/scripts/rvm”
Now close all open terminals and open a new one!
If you don’t have sudo installed or your current user doesn’t have the privileges to execute it, run:
rvm autolibs read-only
Then closely watch the output of the next step for something like “Missing required packages:”. If it appears, hit Ctrl+C and install all the packages listed there.
Ensure the currently recommend version of Ruby is installed:
rvm install 1.9.3-p448
3. Get the source
It’s time to download Diaspora! As your diaspora user run:
cd ~ git clone -b master git://github.com/diaspora/diaspora.git cd diaspora
Don’t miss the cd diaspora, all coming commands expect to be run from that directory!
cp config/database.yml.example config/database.yml cp config/diaspora.yml.example config/diaspora.yml
Now open config/database.yml and config/diaspora.yml in your favorite text editor and carefully review them, they are extensively commented.
Important values in config/diaspora.yml
- environment.url: Set the public facing URL to your pod here, for example for https://pod.geraspora.de this would be https://pod.geraspora.de
- environment.certificate_authorities: You have to set this, one of the examples should fit. If the file in the example doesn’t exist you’re missing a package, in most cases it’s named ca-certificates.
- server.rails_environment: You must set this to production. The server section is read by ./script/server and most alternative startup methods to setup the correct environment.
- environment.require_ssl: If for some reason you can’t run your pod on HTTPS (we highly encourage you to do it!), set this to false to prevent a redirect from http:// to https://
You most likely have already a webserver running on port 80 (http) and 443 (https). It also should serve Diasporas static content and forward all other requests to Diaspora. Here are some example configurations to achieve that:
It’s time to install the Ruby libraries required by Diaspora:
RAILS_ENV=production bundle install —without test development
This takes quite a while. You should get a green success message when it’s finished, if that’s no the case you should seek for help on the mailing list or the IRC channel.
Running the manual gem install command shown in the error message can sometimes show a clearer error message if the bundle command fails.
6. Database setup
Double check your config/database.yml looks right and run:
RAILS_ENV=production bundle exec rake db:create db:schema:load
7. Precompile assets
bundle exec rake assets:precompile
8. Start Diaspora
It’s time to start Diaspora: