Installed One-Click Gitlab Droplet. Now want OwnCloud and a regular server. How?

July 5, 2016 765 views
Let's Encrypt One-Click Install Apps Nginx Ubuntu

Okay. So I installed a droplet using one-click Gitlab which did the setup for me. I made a subdomain called "" which points to my Gitlab page. I then used Lets Encrypt to secure it via this guide here.

The trouble I am having now is I want to install Owncloud but apparently I dont know where Nginx is (that used by Gitlab) or even if i have to install a fresh version. I also want to install owncloud and make "" point to it.

Is there a one-click for owncloud to install? (Other than running another droplet) or atleast a guide?

Also how can I make my regular domain stop pointing to Gitlab?


2 Answers


I agree with @BrookDO.

OwnCloud, much like GitLab, is a purpose-specific application and is designed to be ran on its own instance (Droplet/VPS, LXC Container, Docker Container, etc).

All arguments aside, only one prevails in my eyes (from a security standpoint) and that would be that when it comes to data backup, you never host backups on public servers as any successful attack on such a server could lead to such data being exposed and made available to anyone that should request it.

You can, of course, ignore that warning, in which case NGINX, by default, is going to store any and all configuration to:


And the primary configuration file would be:


Near the bottom of that file, unless the server blocks are in the file above, you should see a line such as:

include /some/path

...which is normally the path to the individual files that separate the server blocks from the primary configuration file (which is the ideal way to configure each domain). You really don't want one huge nginx.conf file as it's hard to read and harder to troubleshoot.

  • Thing is, running another droplet would cost more money and im not willing to spend more just for ownCloud. Also Nginx is not installed there because there is no directory that exists.

    • @mzbd

      Correct, though IMO, it's worth an extra $5-$10 to safeguard backups and ensure that they aren't subject to exposure in the event of a successful attack taking place.

      That said, I deployed DigitalOceans GitLab one-click and it does not appear that NGINX is installed by default. You would need to compile it manually or use the repository package that resides in the Ubuntu (14.04) repositories. To do this:

      apt-get update \
      && apt-get upgrade -y \
      && apt-get install -y nginx

      Once the above command finishes, you'll find the NGINX configuration in /etc/nginx. Since the Droplet doesn't seem to be using NGINX, but it is using standard web ports, you'll need to make sure that when configuring your server blocks that you chose a port other than 80 as NGINX will fail to start since GitLab is using that port.

      • ahh yes! When I tried to install apache, it threw up an error since Gitlab was taking the default port and thats where i am stuck.

        I want gitlab to only show up on "". Right now, any subdomain i configure, it seems to auto-redirect to

        This is the part i need help fixing

        • @mzbd

          The sub-domain issue is because GitLab is setup to work on the default HTTP port (80), thus any traffic to that port is going to either resolve directly (in the case of mydomain.ext) or resolve by WildCard (meaning anysub.mydomain.ext routes to mydomain.ext) unless configured otherwise.

          If the goal is to run NGINX, GitLab and OwnCloud, the one-click installer most likely isn't the best option. In such a case, I'd recommend starting with a fresh Droplet, installing NGINX, then PHP (for OwnCloud), configuring PHP-FPM (used by NGINX), and then installing GitLab followed by OwnCloud (or vice versa).

          Going this route, you're in control from the start. It's a bit more to do, though as the one-click installer is a pre-configured instance, you'd need to find out where everything is before you could really begin to modify the pre-existing configuration to achieve what you're looking to do.

          The best way to do this on a fresh Droplet would be to update the OS packages, upgrade those that need it, install basic packages for building and then install NGINX, the packages required to install GitLab, and PHP.

          If on Ubuntu 14.04, you can use the following (copy & paste to the CLI) and it'll handle what I mentioned above.

          sudo apt-get update \
          && sudo apt-get upgrade -y \
          && sudo apt-get install -y build-essential make automake autoconf cmake gcc g++ \
          curl bison flex bc zip unzip git-core zlib1g-dev libyaml-dev libssl-dev \
          libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl openssh-server \
          checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev logrotate \
          python-docutils pkg-config cmake nodejs nginx php5-fpm php5-common php5-dev \
          php5-cli php5-curl php5-gd php5-json php5-mysqlnd php5-readline php5-recode \
          php5-sqlite php5-xsl php5-imagick php5-intl php5-mcrypt php5-ps php5-redis \
          postfix postgresql postgresql-client libpq-dev postgresql-contrib redis-server \
          && pear config-set php_ini /etc/php5/fpm/php.ini \
          && pecl config-set php_ini /etc/php5/fpm/php.ini

          The above also correctly sets the PHP ini file for PECL & Pear (which often is not correctly set, thus attempting to install packages using either fails).

          From there, it's a matter of following the installation guide for GitLab, followed by OwnCloud and finally, making sure NGINX is setup correctly.

          Installing GitLab w/NGINX

          Setup & Install OwnCloud

          Under "Get ownCloud Server", choose "Download" and then make sure you're on the "Archive" tab. You can download either archive file. This is just the script itself, so you'll need to create a home directory and then extract the archive there.

          Something such as /home/owncloud/public_html will work, and you'll extract the archive to the ./public_html directory.

          The following creates the directory, creates the owncloud user, downloads the archive & extracts it, then changes the ownership of all files and directories to the user (as you shouldn't be running user scripts as root).

          mkdir -p /home/owncloud/public_html \
          && useradd -d /home/owncloud owncloud \
          && cd /home/owncloud/public_html \
          && wget \
          && unzip \
          && rm \
          && mv owncloud/* . \
          && rm -rf owncloud \
          && chown -R owncloud:owncloud /home/owncloud

          From there it's a matter of configuring NGINX to point to GitLab and OwnCloud by setting up the server blocks as well as making sure NGINX + PHP-FPM work together.

          The GitLab installation guide will go over how to setup NGINX + GitLab, so from there you really only have to worry about setting up NGINX + PHP-FPM for OwnCloud.

          • Hey! First of all, thank you very much for the script! I also got NGINX+PHP-FM working (I was wondering why Chrome was forcing me to download a php file instead of just displaying it)

            Now, I installed Gitlab here:

            And the directions posted says I need to run this command here:

            sudo cp lib/support/nginx/gitlab /etc/nginx/sites-available/gitlab
            sudo ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlab

            Thing is, " lib/support/nginx/gitlab" does not even exist which makes me stuck.

            What do i do from there?

            Edit: One last thing. Would it be a good idea to move the owncloud directory to "/usr/share/nginx/html" or I shouldnt and only use the default "/home/owncloud/public_html" and just use the server block to point to it

@mzbd - The number of comments are limited per reply, so I'm starting a new one here.

You can find a copy of the NGINX server block that it's referencing at the URL below. From looking at the guide, I believe it assumes that you're working from /.

You'd simply need to copy & paste that to a file in the directory it's referencing. So in this case, you would:

nano /etc/nginx/sites-available/gitlab

Copy the server block from the URL above, paste that in to the open file and then CTRL + X, then y and hit enter. Once the file is there, the command:

sudo ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlab

Is creating a symlink, or reference point for the file in the sites-enabled directory. For simplicity, I'd go ahead and do it, though in all reality, NGINX doesn't require that you use the sites-* directories. Server blocks can be stored anywhere NGINX can read from (though they shouldn't be stored in the users directories, i.e. public directories).

As for the home directories, personally, I prefer to use /home/ as that's what it was intended for (it's also the directory that GitLab is using too). This keeps NGINX configuration separate from user data entirely.

Have another answer? Share your knowledge.