Why Discourse can be only installed from SSH?

Hi, i am curios to understand why this great forum software can be only installed from SSH and not with a folder upload and setup file.

Thanks for the help! :slight_smile:

1 Like

Iā€™m not part of the core team, but your question seems to be a general one about ā€˜why this way of doing thingsā€™.

I think the short, simple answer is it is based on Linux and the hugely successful and well proven open-source package management ecosystem.

Discourse is a sum of its parts. Itā€™s not one monolithic component written by one team, but a (albeit hugely significant) layer on top of several pieces of jigsaw each built by several different teams around the globe. Without that arrangement and economies of scale, it would be impossible for such software to exist, no doubt.

The package managers are a way of managing distributed contribution, dependency, complexity, configuration, security and change. It would not be sensible imho to attempt to configure a single zip file with all the dependencies as it would instantly date and the complexity involved in maintaining that and all its dependencies post install without a package manager would be, frankly, ridiculous.

If you decide to use a package manager to manage all that, then why wouldnā€™t you script installation of all the desired packages and dependencies? The computer is connected to the internet after all, and freshly baked versions of all you need are just sitting there, waiting to be downloaded. Then, putting it very simply, to refresh the install with the latest versions of everything, you need only rerun a maintenance, ā€˜upgradeā€™ script. (in reality, you may choose to stick to particular versions of a dependency in order to limit the disruption that might mean to other layers of the software). You also need to have scripts to be run to set up the database based on your configuration, so why not do that in your setup scripts too?

The package managers ensure you get the latest or desired version of each dependency from the trusted location. You know that all the developers involved in those packages contribute bug fixes and changes to that trusted location and organise them in discrete ā€˜versionsā€™. All this cuts down the number of issues you will have in maintaining your install.

On top of this open-source software by its very definition involves publicly maintaining your source code in a ā€˜singleā€™, highly visible, location for all to see in part to encourage trust (you can see everything thatā€™s going on) and foster a community of contribution.

As Discourse is server software (its a website, afterall) you need a simple and secure way of connecting to your remote computer so you can configure it. Ssh is the most popular way of securely connecting to your cloud server. Using package management helps here too, because a very simple command can affect a significant change on the remote server without having to type lots of commands or manually upload anything. Itā€™s extremely bandwidth efficient to do this too, so you can maintain you server reliably from the very slowest of connections as you are not remotely viewing a complex GUI of any kind.

7 Likes

TL;DR of the above :arrow_up: Discourse is complex piece of software that depends on a lot of other programs/libraries. This is not a Linux specific thing. It would like asking, why canā€™t I install any program on Windows by simply copying a folder. Itā€™s a bit more complicated than that. :slight_smile:

To answer your question more specifically, we would probably need to know to which software are you comparing here. For example, a lot of software that you can install like that is only working, because the server is already preconfigured to support it (if it is e.g. somethingn written in PHP).

6 Likes

Hi @danekhollas ,
thank you for your reply!

Many thanks also to @merefield with a more complex reply that itā€™s more harder to understand for me.

Usually, also if i manage a VPS (CentOs) so sometime need to use SSH for update OS or for some server settings, i install software like PHPBB, live helper chat, Wordpress, etc by simply upload the ā€œfolderā€ than follow the install procedure.

I do not know nothing about use SSH, use a package managers. Maybe I can found online how install but not always how to uninstall something installed by SSH also i am not sure where the install will save files (one place or more than one).

So i really like this forum, want try but i am scared to use SSH because i do not want compromise my server or install something that i do not know how to remove.

Yes maybe usually I use PHP programmed software. This forum is not made in PHP? So maybe works different on install process.

1 Like

Hehe, I donā€™t think PHP is popular around here, I am sure @codinghorror et al have some strong opinions about it :smiley: Dicourse is written in a framework called Ruby on Rails, but thatā€™s not really important.

SSH is nothing more than a protocol to connect to your server. It does not have anything to do with the installation per se. So you really donā€™t need to worry about this part, as long as you have a strong password.

Actually, installing discourse is safer than installing other software. It uses something called Docker, which is basically a box/container that is more or less completely isolated from the rest of your system. Which means thatā€¦

everything should be contained and you donā€™t have to worry that much.

That is not to say that it is very easy to install. I would suggest you should definitely try it. In order to be completely safe and worry-free, Iā€™d just rent a separate VPS (folks here recommend Digital Ocean) and try the official installation guide.

5 Likes

A last question on this topic if I can:
In this wizard I do not see the setup are asking for database credentials. Why? Not need to setup a database?

2 Likes

Thatā€™s done as part of the script. It uses its own dedicated instance fo a PostgreSQL database.

2 Likes

I do not understand. No need to setup a database?

Its done for you, automagically

1 Like

Think of it as an application rather than a website. Providing you install on a supported OS the installer handles all the components necessary to use it. Database, webserver, libraries and code are all handled by the one installer.

Itā€™s also why Discourse canā€™t be installed on shared hosting, which typically only offers PHP/MySQL.

5 Likes

When you upload files into a folder, the code is usually executed by a PHP interpreter (a program which reads your application script files and executes the code within them), which is usually (pre)installed as part of your web server suite.

However, Discourse is not written in PHP. The server side of Discourse is written in Ruby on Rails and it needs a separate application server in order to work. This software is not preinstalled and therefore it is bundled within the Discourse distribution. This is a much more complicated setup because you actually need to install and configure extra software where the Discourse application will run on top of.

4 Likes

Thank you so much for all help.

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.