How to Install Pydio Cells on AlmaLinux 9
Table of Contents
ToggleIn this guide, we’ll show you how to install Pydio Cells on an Alma Linux 9 server. You’ll be installing Pydio Cells with the MariaDB database server and Httpd web server.
Prerequisites
To get started with this guide, make sure you have the following:
- An Alma Linux 9 server
- A non-root user with administrator privileges
- A domain name pointed to server IP address
- An SELinux with the status enabled and permissive
Installing dependencies
Before installing Pydio Cells, you need to install dependencies on your Alma Linux server. This includes the EPEL repository, MariaDB database server, Httpd web server, and some system tools such as wget and nano.
First, run the ‘dnf‘ command below to add the EPEL repository, and install the MariDB server and Httpd web server. Input ‘Y‘ to confirm the installation.
sudo dnf install epel-release mariadb-server httpd wget nano
After the installation is complete, run the ‘systemctl‘ command below to start, enable, and verify the ‘httpd‘ service. You’ll see the ‘httpd‘ service is running and enabled.
sudo systemctl enable --now httpd sudo systemctl status httpd
Now run the following command to start and enable the ‘mariadb‘ service. And then, verify it to ensure that the service is running.
sudo systemctl enable --now mariadb sudo systemctl status mariadb
In the following output, you can see the MariaDB server is running and enabled.
Lastly, run the ‘firewall-cmd‘ command below to open both ‘http‘ and ‘https‘ ports on your system. Then, reload the firewalld rules to apply your changes.
sudo firewall-cmd --add-service={http,https} --permanent sudo firewall-cmd --reload
Configuring MariaDB server
After you’ve installed dependencies, you need to secure the MariaDB server installation and create a new database and user for the Pydio Cells server installation. You’ll be securing MariaDB with the ‘mariadb-secure-installation‘ command, and then create a new database and user through the ‘mariadb‘ client.
To secure MariaDB server installation, execute the ‘mariadb-secure-installation‘ command below.
sudo mariadb-secure-installation
During the process, you’ll be asked about the following configurations:
- Switch local authentication to unix_socket? Input n.
- Set up the new MariaDB root password. Input y to confirm, then type the new password for your MariaDB server deployment.
- Remove anonymous user? Input y to confirm.
- Remove the default database test from the deployment?. Input y to confirm.
- Disallow MariaDB root login from remote connections? Input y to confirm.
- Reload table privileges and apply the changes. Input y and press ENTER.
Now that the MariaDB server is secured, you’ll create a new database and user for the Pydio Cells installation.
Log in to the MariaDB server with the ‘mariadb‘ command below. Enter your MariaDB root password when prompted.
sudo mariadb -u root -p
Run the following queries to create a new database ‘cells‘, and a new user ‘pydio‘, with the password ‘p4ssw0rd’. You can adjust the database details as needed.
CREATE DATABASE cells; CREATE USER 'pydio'@'localhost' IDENTIFIED BY 'p4ssw0rd'; GRANT ALL PRIVILEGES ON cells.* to 'pydio'@'localhost'; FLUSH PRIVILEGES;
Now check the privileges for user ‘pydio‘ to ensure permission and privileges to the database ‘cells‘.
SHOW GRANTS FOR 'pydio'@'localhost';
You can see below that the database ‘cells‘ are accessible through the ‘pydio‘ user.
Type ‘quit’ to exit from the MariaDB server.
Downloading Pydio Cells
With the MariaDB database configured, you’re ready to download Pydio Cells. In this section, you’ll be setting up the ‘pydio’ user, downloading Pydio Cells, setting up the installation directory and environment variables, and allowing the Pydio Cells to run on the privileged ports.
Create a new user and group ‘pydio‘ with the following command.
sudo useradd -m -s /bin/bash pydio
Create new directories ‘/opt/pydio/bin‘ and ‘/var/cells‘ with the command below. And then change the ownership of both directories to the user ‘pydio‘.
sudo mkdir -p /opt/pydio/bin /var/cells sudo chown -R pydio:pydio /opt/pydio/bin /var/cells
Now create a new env file ‘/etc/profile.d/cells-env.sh‘ with the ‘nano‘ editor.
sudo nano /etc/profile.d/cells-env.sh
Enter the following script to set up environment variables for Pydio Cells. Make sure to change the ‘CELLS_EXTRERNAL‘ address to match the domain name of your Pydio installation.
export CELLS_WORKING_DIR=/var/cells export CELLS_BIND=127.0.0.1:8080 export CELLS_EXTERNAL=https://cells.howtoforge.local
When done, save and exit the file.
Now run the command below to make the env file ‘/etc/profile.d/cells-env.sh‘ executable.
sudo chmod +x /etc/profile.d/cells-env.sh
Next, run the command below to download Pydio Cells binary file for Linux to the ‘/opt/pydio/bin/cells‘.
export distribId=cells wget -O /opt/pydio/bin/cells https://download.pydio.com/latest/${distribId}/release/{latest}/linux-amd64/${distribId}
Once downloaded, run the following command to make the ‘cells‘ binary file executable and allow it to bind on the privilege ports.
sudo chmod a+x /opt/pydio/bin/cells sudo setcap 'cap_net_bind_service=+ep' /opt/pydio/bin/cells sudo ln -s /opt/pydio/bin/cells /usr/local/bin/cells
Now log in as the user ‘pydio‘ with the following:
su - pydio
Check environment variables for Pydio Cells with the following – Make sure the output matches within the env file ‘/etc/profile.d/cells-env.sh‘.
echo $CELLS_WORKING_DIR echo $CELLS_BIND echo $CELLS_EXTERNAL
Lastly, check the ‘cells’ version with the command below.
cells version
In the following output, you can see that Pydio Cells version.
Installing Pydio Cells through the command line
Now you’ll start installing Pydio Cells from the command line. With the ‘cells‘ command, you’ll be setting Pydio Cells installation with the MariaDB database, setting up the admin user and password, and setting up the storage location for storing user data.
To start, run the command below to configure the Pydio Cells installation from the terminal.
cells configure --cli
Now you’ll be prompted with the following configurations:
- Database Connection: select via TCP, then input details of your MariaDB database host, port, user, and password.
- MongoDB configuration: Input n for no.
- Administrative User Configuration: input your admin user and password for Pydio Cells.
- Default storage location: press ENTER to use default and continue.
After the process is complete, you’ll see the following output:
Setting up systemd service file for Pydio Cells
From the previous step, you can start the Pydio Cells with the ‘cells start’ command. To make this easier, you’ll instead use the systemd ‘systemctl’ for managing the Pydio Cells service. So now you’ll be creating a new systemd service file.
Create a new ‘/etc/systemd/system/cells.service’ file with the ‘nano’ editor.
sudo nano /etc/systemd/system/cells.service
Insert the configuration below to run Pydio Cells as a systemd service. Make sure to change the ‘CELLS_EXTERNAL’ with your domain name.
[Unit] Description=Pydio Cells Documentation=https://pydio.com Wants=network-online.target After=network-online.target AssertFileIsExecutable=/opt/pydio/bin/cells [Service] User=pydio Group=pydio PermissionsStartOnly=true AmbientCapabilities=CAP_NET_BIND_SERVICE ExecStart=/opt/pydio/bin/cells start Restart=on-failure StandardOutput=journal StandardError=inherit LimitNOFILE=65536 TimeoutStopSec=5 KillSignal=INT SendSIGKILL=yes SuccessExitStatus=0 WorkingDirectory=/home/pydio # Add environment variables Environment=CELLS_WORKING_DIR=/var/cells Environment=CELLS_BIND=127.0.0.1:8080 Environment=CELLS_EXTERNAL=https://cells.howtoforge.local [Install] WantedBy=multi-user.target
Save the file and exit the editor.
Now run the command below to reload the systemd manager.
sudo systemctl daemon-reload
Lastly, execute the ‘systemctl‘ command below to start, enable, and verify the ‘cells‘ service.
sudo systemctl enable --now cells sudo systemctl status cells
In this output, you can see the ‘cells‘ service is running in the background as a systemd service.
Configuring Httpd as a reverse proxy
At this point, the Pydio Cells are running on your Alma Linux server on port ‘8080’. To make it accessible from the client, you’ll be creating a Httpd virtual host file as a reverse proxy to the Pydio Cells server. You’ll also generate SSL/TLS certificates from Letsencrypt to secure data transfer between the client and the Pydio Cells server.
First, run the ‘dnf‘ command below to install ‘certbot’ to your system.
sudo dnf install certbot -y
Now create a new dummy web root directory and change the ownership to the ‘apache‘ user.
sudo mkdir -p /var/www/html/cells/public_html sudo chown -R apache:apache /var/www/html/cells/public_html
Run the ‘certbot‘ command below to generate SSL/TLS certificates for Pydio Cells. Make sure to change the email address and the domain name with your information.
sudo certbot certonly --agree-tos --email [email protected] --no-eff-email --webroot -w /var/www/html/cells/public_html -d cells.howtoforge.local
Next, create a new Httpd virtual host configuration ‘/etc/httpd/conf.d/pydio.conf‘ with the ‘nano‘ editor.
sudo nano /etc/httpd/conf.d/pydio.conf
Insert the configuration below and make sure to change the ‘ServerName‘ option with your domain name.
<VirtualHost *:80> ServerName cells.howtoforge.local RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} RewriteCond %{SERVER_NAME} =cells.howtoforge.local RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] </VirtualHost> <VirtualHost *:443> ServerName cells.howtoforge.local AllowEncodedSlashes On RewriteEngine On # be aware of this # Allow reverse proxy via self-signed certificates SSLProxyEngine On SSLProxyVerify none SSLProxyCheckPeerCN off SSLProxyCheckPeerName off SSLProxyCheckPeerExpire off ## The order of the directives matters. # If Cells is not running with https, consider using ws instead of wss ProxyPassMatch "/ws/(.*)" wss://localhost:8080/ws/$1 nocanon ## This rewrite condition is required if using Cells-Sync # RewriteCond %{HTTP:Content-Type} =application/grpc [NC] # RewriteRule /(.*) h2://localhost:8080/$1 [P,L] ProxyPass "/" "https://127.0.0.1:8080/" ProxyPassReverse "/" "https://127.0.0.1:8080/" ErrorLog /var/log/httpd/error.log CustomLog /var/log/httpd/access.log combined SSLCertificateFile /etc/letsencrypt/live/cells.howtoforge.local/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/cells.howtoforge.local/privkey.pem #Include /etc/letsencrypt/options-ssl-apache.conf </VirtualHost>
Save the file and exit the editor when finished.
Now run the ‘apachectl‘ command below to verify your Apache syntax. If you’ve proper Apache configuration, you’ll see an output ‘Syntax is OK‘.
sudo apachectl configtest
Lastly, run the ‘systemctl’ command below to restart the ‘httpd‘ web server and apply your changes. With this, your Pydio Cells installation should be finished and accessible.
sudo systemctl restart httpd
Accessing Pydio Cells
Open your web browser and visit the domain name of your Pydio Cells installation such as https://cells.gratisvps.net/blog If the installation is successful, you’ll see the Pydio Cells login page.
Input your admin user and password to log in.
If you have the correct credentials, you’ll see the Pydio Cells user dashboard like the following.
From here, you can now try uploading files from your local computer to the Pydio Cells server. In the following screenshot, I’ve uploaded files to the Pydio Cells and was successful.
Conclusion
Congratulations! You’ve finished the installation of Pydio Cells on the Alma Linux 9 server. You have the Pydio Cells running with the MariaDB database server and the Httpd web server. On top of that, you’ve also secured Pydio Cells installation with HTTPS through Certbot and Letsencrypt.