How to Install Samvera Hyrax on POP! OS Latest

Samvera Hyrax is an open-source digital repository and scholarly communication platform, which is widely used in higher education institutions worldwide. POP! OS is a user-friendly Linux distribution that is based on Ubuntu. In this tutorial, we will show you how to install Samvera Hyrax on the latest version of POP! OS.

Prerequisites

Before we proceed with the installation, please make sure that you have the following prerequisites:

Installation

  1. Update the package index and upgrade the system packages by running the following command in the terminal:

    sudo apt update && sudo apt upgrade
    
  2. Install the required dependencies by running the following command:

    sudo apt-get install -y openjdk-8-jdk libxml2-dev libxslt-dev imagemagick ghostscript redis-server libreoffice libreoffice-headless ffmpeg
    
  3. Install Ruby and its dependencies by running the following commands:

    sudo apt-get install -y ruby-full ruby-bundler ruby-dev zlib1g-dev liblzma-dev libmysqlclient-dev libpq-dev
    gdebi libsqlite3-dev libxmlsec1-dev
    
  4. Install MariaDB server and client by running the following command:

    sudo apt-get install mariadb-server mariadb-client
    
  5. Start the MariaDB service and configure it to start at boot time by running the following commands:

    sudo systemctl start mariadb
    sudo systemctl enable mariadb
    
  6. Secure the MariaDB installation by running the following command:

    sudo mysql_secure_installation
    
  7. Create a new database and user for Samvera Hyrax by running the following commands:

    sudo mysql -u root -p
    
    CREATE DATABASE hyrax_production;
    
    CREATE USER 'hyraxuser'@'localhost' IDENTIFIED BY 'password';
    
    GRANT ALL PRIVILEGES ON hyrax_production.* TO 'hyraxuser'@'localhost';
    
    FLUSH PRIVILEGES;
    
    exit
    
  8. Install Samvera Hyrax by running the following commands:

    git clone https://github.com/samvera/hyrax.git
    cd hyrax
    bundle install
    
  9. Configure the database connection by creating a configuration file by running the following command:

    cp config/database.yml.erb config/database.yml
    

    Open the database.yml file in a text editor and add the following lines:

    production:
      adapter: mysql2
      database: hyrax_production
      username: hyraxuser
      password: password
      host: localhost
      encoding: utf8mb4
      pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
      timeout: 5000
    
  10. Initialize the database by running the following commands:

bundle exec rails db:migrate RAILS_ENV=production
bundle exec rails hyrax:default_admin_set:create RAILS_ENV=production
bundle exec rails hyrax:default_collection_types:create RAILS_ENV=production
  1. Start the Samvera Hyrax server by running the following commands:
bundle exec rails server -d -e production
  1. Finally, open the web browser and enter http://localhost:3000/ in the address bar to access the Samvera Hyrax web interface.

Conclusion

In this tutorial, we have shown you how to install Samvera Hyrax on the latest version of POP! OS. We hope that this tutorial has helped you to successfully set up a digital repository and scholarly communication platform on your server.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!