Top Menu

Jump to content
Home
    • Projects
    • Work packages
    • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Professional support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?
      Create a new account

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
  • Roadmap
  • Work packages
  • Calendars
  • Team planners
  • Boards
  • Forums
  • Wiki
    • Table of contents
      • Expanded. Click to collapseCollapsed. Click to showDeveloper
        • Hierarchy leafAccessibility Checklist
        • Hierarchy leafCode Review Guidelines
        • Expanded. Click to collapseCollapsed. Click to showContribution
          • Hierarchy leafGit Workflow
          • Hierarchy leafTranslations
        • Expanded. Click to collapseCollapsed. Click to showDeveloping Plugins
          • Hierarchy leafDeveloping an OmniAuth Authentication Plugin
        • Hierarchy leafRelease Process
        • Hierarchy leafReport a bug
        • Hierarchy leafSecurity
        • Hierarchy leafSetting up an OpenLDAP server for testing
        • Hierarchy leafTheme Features
      • Hierarchy leafDownload
      • Expanded. Click to collapseCollapsed. Click to showFeature tour
        • Hierarchy leafRelease Notes OpenProject 30
        • Expanded. Click to collapseCollapsed. Click to showRelease Notes OpenProject 30 - Overview
          • Hierarchy leafGlossary
          • Hierarchy leafRelease Notes - Accessibility
          • Hierarchy leafRelease Notes - Accessibility changes
          • Hierarchy leafRelease Notes - Add work package queries as menu items to sidebar
          • Hierarchy leafRelease Notes - Copy projects based on Templates
          • Hierarchy leafRelease Notes - Design changes
          • Hierarchy leafRelease Notes - Fixed Bugs
          • Hierarchy leafRelease Notes - Keyboard Shortcuts
          • Hierarchy leafRelease Notes - Project settings
          • Hierarchy leafRelease Notes - Ruby&Rails Update
          • Hierarchy leafRelease Notes - Security
          • Hierarchy leafRelease Notes - Timelines
          • Hierarchy leafRelease Notes - Work packages
      • Hierarchy leafHowto create animated gifs
      • Hierarchy leafMigration Squashing
      • Hierarchy leafMod security
      • Hierarchy leafNew work package page
      • Hierarchy leafOP3 to OP4 Debian upgrade
      • Hierarchy leafOP4 Ubuntu1404 Stable with MySQL in production
      • Hierarchy leafOpenProject 40 Development Setup
      • Expanded. Click to collapseCollapsed. Click to showOpenProject Foundation
        • Hierarchy leafBoards
        • Hierarchy leafMembers
        • Hierarchy leafOPF-Meetings
        • Hierarchy leafStatutes
      • Expanded. Click to collapseCollapsed. Click to showRelease Notes
        • Hierarchy leafOpenProject released on Bitnami
      • Expanded. Click to collapseCollapsed. Click to showRelease Notes OpenProject 40 - Overview
        • Hierarchy leafRelease Notes OpenProject 40 - Accessibility improvements
        • Hierarchy leafRelease Notes OpenProject 40 - Column header functions in work package table
        • Hierarchy leafRelease Notes OpenProject 40 - Improved Design
        • Hierarchy leafRelease Notes OpenProject 40 - Integrated query title on work package page
        • Hierarchy leafRelease Notes OpenProject 40 - Integrated toolbar on work package page
        • Hierarchy leafRelease Notes OpenProject 40 - OmniAuth integration for OpenProject
        • Hierarchy leafRelease Notes OpenProject 40 - Work package details pane
      • Expanded. Click to collapseCollapsed. Click to showSecurity and privacy
        • Hierarchy leafFAQ
      • Expanded. Click to collapseCollapsed. Click to showSupport
        • Expanded. Click to collapseCollapsed. Click to showDownload and Installation
          • Hierarchy leafInstallation MacOS
          • Expanded. Click to collapseCollapsed. Click to showInstallation OpenProject 3 0
            • Hierarchy leafDebian Stable with MySQL in production
            • Hierarchy leafInstallation Ubuntu
            • Hierarchy leafInstallation Windows
            • Hierarchy leafInstallation on Centos 65 x64 with Apache and PostgreSQL 93
          • Expanded. Click to collapseCollapsed. Click to showInstallation OpenProject 40
            • Hierarchy leafOP4 Debian Stable with MySQL in production
          • Expanded. Click to collapseCollapsed. Click to showMigration paths
            • Hierarchy leafFrom Chilliproject to OpenProject
            • Hierarchy leafMigration 15 to 30
            • Hierarchy leafMigration 24 to 30
            • Hierarchy leafMigration Redmine 2x › OpenProject 30
            • Hierarchy leafOpenProject 3 Migration
          • Hierarchy leafOpenProject 40
        • Expanded. Click to collapseCollapsed. Click to showNews
          • Hierarchy leafNew OpenProject Translations Plugin
          • Hierarchy leafNew Plugin on OpenProjectorg Local Avatars
          • Hierarchy leafNew design for OpenProject
          • Hierarchy leafNews Accessibility workshop for OpenProject
          • Hierarchy leafNews Glossary for OpenProject
          • Hierarchy leafNews Heartbleed fixed
          • Hierarchy leafNews Icon Fonts
          • Hierarchy leafNews OpenProject 30 Release
          • Hierarchy leafNews Release GitHub Integration Plugin
          • Hierarchy leafNews Success Story Deutsche Telekom
          • Hierarchy leafNews Timelines
          • Hierarchy leafOpenProject 3013 released
          • Hierarchy leafOpenProject 3017 released
          • Hierarchy leafOpenProject 40 released
          • Hierarchy leafOpenProject 40 will be coming soon
          • Hierarchy leafOpenProject 405 released
          • Hierarchy leafOpenProject and pkgrio
          • Hierarchy leafOpenProject news moved to a new blog
          • Hierarchy leafOpenProjectBitnami
          • Hierarchy leafPackager version with plugins released ("Community edition")
          • Hierarchy leafRegistration OpenProject-Foundation
          • Hierarchy leafRelease OpenProject AuthPlugins
          • Hierarchy leafUpdates on OpenProject
          • Hierarchy leafWe need your feedback for the the new fullscreen view for work packages
        • Hierarchy leafOpenProject Plug-Ins
      • Hierarchy leafWiki
You are here:
  • OpenProject 40 Development Setup

Content

OpenProject 40 Development Setup

  • More
    • Print
    • Table of contents

OpenProject 4.0 Development Setup on Debian 7.7

To develop OpenProject a setup similar to that for using OpenProject in production is needed. However, we can skip some parts of the installation guide, so that we can get up a development environment a little easier.

  1. This guide requires that you have a clean Debian 7.7 x64 installation with administrative rights.
  2. OpenProject will be installed with a MySQL database (the guide should work analogous with PostgreSQL).
  3. OpenProject will be served in a development environment

If you find any bugs or you have any recommendations for improving this tutorial, please, feel free to comment in the OpenProject forums.

Prepare your environment

Install tools needed to compile Ruby and run OpenProject:

[dev@debian]# sudo apt-get update
[dev@debian]# sudo apt-get install git curl build-essential zlib1g-dev libyaml-dev libssl-dev libmysqlclient-dev libpq-dev libsqlite3-dev memcached libffi5

Install Database (MySQL) packages

During installation, you have to enter a password for the mysql root-user.

[dev@debian]# sudo apt-get install mysql-server mysql-client

As a reference, we have installed the following MySQL version:

[dev@debian]# mysql --version
  mysql  Ver 14.14 Distrib 5.5.40, for debian-linux-gnu (x86_64) using readline 6.2

Create the OpenProject MySQL-user and database:

[dev@debian]# mysql -u root -p

You may replace the string “openproject” with the desired username and database-name. The password “my_password” should definitely be changed.

mysql> CREATE DATABASE openproject CHARACTER SET utf8;
mysql> CREATE USER 'openproject'@'localhost' IDENTIFIED BY 'my_password';
mysql> GRANT ALL PRIVILEGES ON openproject.* TO 'openproject'@'localhost';
mysql> \q

Install Node.js

We will install the latest 0.10.x version of Node.js via nodeenv :

[dev@debian]# sudo apt-get install python python-pip
[dev@debian]# sudo pip install nodeenv

Install Ruby

Switch to your development directory. In this guide we develop straight in the $HOME directory.

[user@debian]# cd ~

… and install RVM (Ruby Version Manager)

[dev@debian]# \curl -sSL https://get.rvm.io | bash -s stable
[dev@centos]# source $HOME/.rvm/scripts/rvm
[dev@debian]# export -f rvm_debug
[dev@debian]# rvm autolibs disable
[dev@debian]# rvm install 2.1.4
[dev@debian]# rvm use --default 2.1.4
[dev@debian]# gem install bundler

Activate Node.js

[dev@debian]# nodeenv nodeenv
[dev@debian]# source ./nodeenv/bin/activate
[dev@debian]# npm -g install bower

As a reference, the following Node.js and NPM versions have been installed on our system:

[dev@debian]# node --version
                      v0.10.32
[dev@debian]# npm --version
                      1.4.28
[dev@debian]# bower --version
                      1.3.12

Install OpenProject

[dev@debian]# git clone https://github.com/opf/openproject.git
[dev@debian]# cd openproject
[dev@debian]# bundle install
[dev@debian]# npm install
[dev@debian]# bower install

Note that we have checked out the dev branch of the OpenProject repository. Development in OpenProject happens in the dev-branch (there is no master branch).
So, if you want to develop a feature, create a feature branch from a current dev-branch.

Configure OpenProject

Create and configure the database configuration file in config/database.yml (relative to the openproject-directory.

[dev@debian]# cp config/database.yml.example config/database.yml

Now edit the config/database.yml file and insert your database credentials.
It should look like this (just with your database name, username, and password):

production:
  adapter: mysql2
  database: openproject
  host: localhost
  username: openproject
  password: openproject
  encoding: utf8

development:
  adapter: mysql2
  database: openproject
  host: localhost
  username: openproject
  password: openproject
  encoding: utf8

NOTE: You should validate the database.yml file, for example with http://www.yamllint.com/. YML-files are sensitive to whitespace — It is pretty easy to write invalid .yml files without seeing the error. Validating those files prevents you from such errors.

Finish the Installation of OpenProject

[dev@debian]# bundle exec rake db:create:all
[dev@debian]# bundle exec rake generate_secret_token
[dev@debian]# bundle exec rake db:migrate
[dev@debian]# bundle exec rake db:seed

The db:seed step is optional, but recommended. It creates many users, work packages, news etc. This takes some time, but gives you useful test data.

Run OpenProject as a Developer

You can start OpenProject with:

bundle exec rails server

Your OpenProject installation should be accessible on port 3000 (http). A default admin-account is created for you having the following credentials:

Username: admin
Password: admin

Start Coding

Please have a look at our development guidelines for tips and guides on how to start coding. We have advice on how to get your changes back into the OpenProject core as smooth as possible.
Also, take a look at the doc directory in our sources, especially the how to run tests documentation (we like to have automated tests for every new developed feature).

Troubleshooting

The OpenProject logfile can be found here:

/home/openproject/openproject/log/development.log

If an error occurs, it should be logged there (as well as in the output to STDOUT/STDERR of the rails server process).

Questions, Comments, and Feedback

If you have any further questions, comments, feedback, or an idea to enhance this guide, please tell us at the appropriate community.openproject.org forum.
Follow OpenProject on twitter, and follow the news on openproject.org to stay up to date.

Loading...