Webmail Installation · 6 min read · Sep 25, 2025

Come installare l'ultima versione di RoundCube Webmail su Ubuntu 18.04 LTS

Roundcube è una soluzione di webmail gratuita e open source basata sul web scritta in PHP. È un client IMAP basato sul web, quindi puoi accedere al tuo server di posta elettronica dal tuo browser web. Non è necessario leggere e inviare email da un client di posta desktop. Questo tutorial mostra come installare RoundCube con il server web Apache e protetto da un certificato SSL Let’s Encrypt su Ubuntu 18.04 LTS (Bionic Beaver).

Caratteristiche di RoundCube

  • Supporto MIME, ricerca di messaggi e controllo ortografico.
  • Integrazione della directory LDAP per rubrica.
  • Supporto per più lingue.
  • Supporto per cartelle condivise/globali e ACL IMAP.
  • Caching integrato per un accesso rapido alla casella di posta.
  • Supporto per server SMTP esterni e IDNA.

Requisiti

  • Un server che esegue Ubuntu 18.04 LTS.
  • Un utente non root con privilegi sudo.

Installare il server LAMP

Prima di iniziare, dovresti aggiornare l’elenco dei pacchetti e installare gli aggiornamenti in sospeso:

sudo apt-get update  
sudo apt-get upgrade

Quindi, installa Apache e MariaDB con il seguente comando:

sudo apt-get install apache2 mariadb-server php7.2 php7.2-gd php-mysql php7.2-curl php7.2-zip php7.2-ldap php7.2-mbstring php-imagick php7.2-intl php7.2-xml unzip wget curl -y

Una volta installati tutti i pacchetti, dovrai cambiare l’impostazione del fuso orario nel file php.ini. Puoi farlo con il seguente comando:

sudo nano /etc/php/7.2/apache2/php.ini

Apporta le seguenti modifiche:

date.timezone = Europe/Berlin

Salva e chiudi il file, quindi avvia il servizio Apache e MariaDB e abilitali per l’avvio all’avvio utilizzando il seguente comando:

sudo systemctl start apache2  
sudo systemctl enable apache2  
sudo systemctl start mariadb  
sudo systemctl enable mariadb

Scarica Roundcube

Per prima cosa, dovrai scaricare l’ultima versione di Roundcube sul tuo sistema. Puoi scaricarlo con il seguente comando:

cd /tmp  
wget https://github.com/roundcube/roundcubemail/releases/download/1.3.8/roundcubemail-1.3.8-complete.tar.gz

Una volta completato il download, estrai il file scaricato con il seguente comando:

tar -xvzf roundcubemail-1.3.8-complete.tar.gz

Successivamente, sposta la directory estratta nella directory radice del web server Apache:

mv roundcubemail-1.3.8 /var/www/html/roundcube

Successivamente, dai i permessi appropriati alla directory roundcube:

sudo chown -R www-data:www-data /var/www/html/roundcube  
sudo chmod -R 775 /var/www/html/roundcube

Configura il database

Per impostazione predefinita, l’installazione di MariaDB non è protetta. Quindi dovrai prima proteggerla. Puoi farlo eseguendo il seguente script:

mysql_secure_installation

Rispondi a tutte le domande come mostrato di seguito:

Change the password for root ? N
Remove anonymous users? Y
Disallow root login remotely? Y
Remove test database and access to it? Y
Reload privilege tables now? Y

Una volta che MariaDB è protetta, accedi alla shell di MariaDB utilizzando il seguente comando:

mysql -u root -p

Inserisci la tua password di root, quindi crea un database e un utente per Roundcube:

MariaDB [(none)]> CREATE DATABASE roundcubedb;  
MariaDB [(none)]> CREATE USER 'roundcube'@'localhost' IDENTIFIED BY 'password';  
MariaDB [(none)]> GRANT ALL PRIVILEGES ON roundcubedb.* to 'roundcube'@'localhost';

Sostituisci la parola ‘password’ con una password sicura a tua scelta e ricordati di questa password, ne avremo bisogno per l’installazione di roundcube più tardi. Successivamente, svuota i privilegi ed esci dalla shell di MariaDB utilizzando il seguente comando:

MariaDB [(none)]> FLUSH PRIVILEGES;  
MariaDB [(none)]> exit;

Successivamente, devi importare le tabelle iniziali nel database roundcubedb. Puoi farlo utilizzando il seguente comando:

cd /var/www/html/roundcube  
mysql -u roundcube -p roundcubedb < SQL/mysql.initial.sql

Digita la password dell’utente del database roundcube quando richiesto.

Configura Apache per Roundcube

Successivamente, dovrai creare un file di host virtuale Apache per Roundcube. Puoi farlo con il seguente comando:

sudo nano /etc/apache2/sites-available/roundcube.conf

Aggiungi le seguenti righe:


        ServerName example.com                          
        ServerAdmin [email protected]
        DocumentRoot /var/www/html/roundcube

        ErrorLog ${APACHE_LOG_DIR}/roundcube_error.log
        CustomLog ${APACHE_LOG_DIR}/roundcube_access.log combined

        
                Options -Indexes
                AllowOverride All
                Order allow,deny
                allow from all
        

sostituisci example.com con il tuo nome di dominio. Salva e chiudi il file, quindi abilita il file dell’host virtuale utilizzando il seguente comando:

sudo a2ensite roundcube

Successivamente, abilita il modulo di riscrittura di Apache e riavvia il server Apache con il seguente comando:

sudo a2enmod rewrite  
sudo systemctl restart apache2

Abilita SSL con Let’s Encrypt per RoundCube

In questo passaggio, abiliteremo SSL per RoundCube utilizzando un certificato SSL gratuito di Let’s Encrypt. Il primo passo è installare il client certbot Let’s Encrypt che utilizzeremo per ottenere il certificato SSL.

sudo apt-get install certbot python-certbot-apache

Richiedi il certificato SSL con questo comando:

sudo certbot --apache

IMPORTANTE: Il nome di dominio o sottodominio che utilizzi per il sito web di RoundCube deve essere accessibile da Internet per ottenere un certificato SSL. Certbot ora farà alcune domande. Vedi le risposte in rosso.

root@server: certbot --apache  
Saving debug log to /var/log/letsencrypt/letsencrypt.log  
Plugins selected: Authenticator apache, Installer apache  
Enter email address (used for urgent renewal and security notices) (Enter 'c' to  
cancel): [email protected]
-------------------------------------------------------------------------------  
Please read the Terms of Service at  
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must  
agree in order to register with the ACME server at  
https://acme-v01.api.letsencrypt.org/directory  
-------------------------------------------------------------------------------  
(A)gree/(C)ancel: a
-------------------------------------------------------------------------------  
Would you be willing to share your email address with the Electronic Frontier  
Foundation, a founding partner of the Let's Encrypt project and the non-profit  
organization that develops Certbot? We'd like to send you email about EFF and  
our work to encrypt the web, protect its users and defend digital rights.  
-------------------------------------------------------------------------------  
(Y)es/(N)o: n
Which names would you like to activate HTTPS for?  
-------------------------------------------------------------------------------  
1: roundcube.example.com  
-------------------------------------------------------------------------------  
Select the appropriate numbers separated by commas and/or spaces, or leave input  
blank to select all options shown (Enter 'c' to cancel): 1  
Obtaining a new certificate  
Performing the following challenges:  
http-01 challenge for roundcube.example.com  
Waiting for verification...  
Cleaning up challenges  
Created an SSL vhost at /etc/apache2/sites-available/roundcube-le-ssl.conf  
Enabled Apache socache_shmcb module  
Enabled Apache ssl module  
Deploying Certificate to VirtualHost /etc/apache2/sites-available/roundcube-le-ssl.conf  
Enabling available site: /etc/apache2/sites-available/roundcube-le-ssl.conf
Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.  
-------------------------------------------------------------------------------  
1: No redirect - Make no further changes to the webserver configuration.  
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for  
new sites, or if you're confident your site works on HTTPS. You can undo this  
change by editing your web server's configuration.  
-------------------------------------------------------------------------------  
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2  
Redirecting vhost in /etc/apache2/sites-enabled/roundcube.conf to ssl vhost in /etc/apache2/sites-available/roundcube-le-ssl.conf
-------------------------------------------------------------------------------  
Congratulations! You have successfully enabled https://roundcube.example.com
You should test your configuration at:  
https://www.ssllabs.com/ssltest/analyze.html?d=roundcube.example.com  
-------------------------------------------------------------------------------
IMPORTANT NOTES:  
- Congratulations! Your certificate and chain have been saved at:  
/etc/letsencrypt/live/roundcube.example.com/fullchain.pem  
Your key file has been saved at:  
/etc/letsencrypt/live/roundcube.example.com/privkey.pem  
Your cert will expire on 2019-06-25. To obtain a new or tweaked  
version of this certificate in the future, simply run certbot again  
with the "certonly" option. To non-interactively renew *all* of  
your certificates, run "certbot renew"  
- Your account credentials have been saved in your Certbot  
configuration directory at /etc/letsencrypt. You should make a  
secure backup of this folder now. This configuration directory will  
also contain certificates and private keys obtained by Certbot so  
making regular backups of this folder is ideal.  
- If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate  
Donating to EFF: https://eff.org/donate-le

L’host virtuale di RoundCube è ora accessibile tramite https.

Accedi a Webmail

Ora, apri il tuo browser web e digita l’URL https://example.com/installer (sostituisci example.com con il tuo nome di dominio nell’URL!). Verrai reindirizzato alla seguente pagina:

Installatore web di RoundCube

Una volta completati tutti i requisiti, fai clic sul pulsante Avanti. Dovresti vedere la seguente pagina:

Configurazione generale:

Configurazione generale

Impostazioni di registrazione e database:

Impostazioni del database

Compila qui i dettagli del database di roundcubedb che hai creato nel passaggio di configurazione del database.

Impostazioni SMTP e IMAP:

Impostazioni SMTP

Plugin:

Plugin

Qui, fornisci tutti i dettagli secondo le tue esigenze, quindi fai clic sul pulsante CREA CONFIG. Dovresti vedere la seguente pagina:

Successivamente, fai clic sul pulsante Continua. Dovresti vedere la seguente pagina:

Configurazione creata

Ora, fai clic sul pulsante Controlla accesso. Dopo aver completato l’installazione, rimuovi la directory /var/www/html/roundcube/installer:

sudo rm -rf /var/www/html/roundcube/installer

Ora, accedi alla tua webmail utilizzando l’URL http://your-ip-address o http://your-domain.com e accedi utilizzando la tua email.

Accesso a Roundcube

RoundCube è stato installato con successo su Ubuntu 18.04 LTS.

Share: X/Twitter LinkedIn

Ricevi i nuovi post nella tua casella di posta.

Nessuno spam. Disiscriviti in qualsiasi momento.