How to Install Mobilizon on Ubuntu Server

Mobilizon is a free, open-source and federated platform to organize events and groups. Installing Mobilizon on Ubuntu Server is a straightforward process.

Step 1: Update the System

Before installing any new software, we need to update the Ubuntu System to ensure that everything is up-to-date. We can do this by running the following command:

sudo apt update && sudo apt upgrade

Step 2: Install Dependencies

Mobilizon has some dependencies that must be installed before Mobilizon can be installed. These dependencies are PostgreSQL, Elixir, and Node.js. Let's install them one by one.

Install PostgreSQL

We can install PostgreSQL by running the following command:

sudo apt install postgresql postgresql-contrib

After installation, we should create a new PostgreSQL user and database for Mobilizon:

sudo -u postgres createuser -P mobilizon_user
sudo -u postgres createdb -O mobilizon_user mobilizon_db

Install Elixir

To install Elixir and its dependencies, we need to add the Erlang Solutions repository:

wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
sudo dpkg -i erlang-solutions_1.0_all.deb

After that, we can install Elixir by running the following command:

sudo apt install elixir

Install Node.js

To install Node.js, we need to add the NodeSource repository:

curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt install nodejs

Step 3: Download and Install Mobilizon

We can download the latest version of Mobilizon from its official website. We need to open the terminal and run the following command:

wget https://github.com/framasoft/mobilizon/releases/download/v1.3.0/mobilizon-1.3.0.tar.gz

After that, we should extract the downloaded archive:

tar xzf mobilizon-1.3.0.tar.gz

Then, we should change the directory to the extracted Mobilizon directory and install the required dependencies by running the following command:

cd mobilizon-1.3.0
mix deps.get && cd assets && npm install && cd ..

Step 4: Configure Mobilizon

Now, we need to configure Mobilizon by editing the config/prod.exs file:

nano config/prod.exs

We need to update the config/prod.exs file as follows:

config :mobilizon,
  app: :mobilizon,
  repo: Mobilizon.Repo,  
  secret_key_base: "<SECRET_KEY_BASE>",
  media_path: "/var/mobilizon/media/uploads",
  sign_up_allowed: true,
  enable_user_email_verification: false,  
  db_url: "ecto://mobilizon_user:<MY_PASSWORD>@localhost/mobilizon_db",
  base_url: "http://<MY_DOMAIN>",
  storage_backend: Mobilizon.Storage.File,
  mail_backend: :swoosh,
  mail_backend_config: [adapter: Swoosh.Adapters.SMTP, server: "<MY_SMTP_SERVER>", username: "<MY_SMTP_USERNAME>", password: "<MY_SMTP_PASSWORD>", port: 587, tls: :if_available, tls_verify: :verify]

Replace <SECRET_KEY_BASE> with a long and random string. Replace <MY_PASSWORD> with the password you set for the mobilizon_user database user during PostgreSQL installation. Replace <MY_DOMAIN> with your domain name. Replace <MY_SMTP_SERVER>, <MY_SMTP_USERNAME> and <MY_SMTP_PASSWORD> with the settings for your SMTP server if you want to send emails from Mobilizon.

Save and close the file by pressing CTRL+X, then Y, then ENTER.

Step 5: Create Database Tables and Run Mobilizon

Now, we're ready to create the database tables and run Mobilizon. We can do this by running the following commands:

sudo chmod 770 /var/mobilizon/media/uploads
MIX_ENV=prod mix ecto.create
MIX_ENV=prod mix ecto.migrate
MIX_ENV=prod mix phx.server

The first command sets the permissions for the upload directory. The next two commands create the database tables and run the database migrations. The final command starts the Mobilizon server.

Step 6: Access Mobilizon

Mobilizon should now be running on your Ubuntu server. You can access it by navigating to http://<MY_DOMAIN>:4000 in your web browser.

Conclusion

In this tutorial, we have shown you how to install Mobilizon on Ubuntu Server. Enjoy exploring Mobilizon!

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!