Hospedagem de Imagens · 8 min read · Dec 29, 2025

Crie um Site de Hospedagem de Imagens com Chevereto-Free no Ubuntu 22.04

Chevereto é um software de hospedagem e compartilhamento de imagens gratuito e de código aberto que permite hospedar seu próprio servidor de hospedagem de imagens na web. É uma solução de hospedagem de imagens auto-hospedada, multipropósito, multiusuário e completa que permite criar sites de hospedagem de imagens responsivos. Oferece muitos recursos, incluindo múltiplos idiomas, importação em massa de imagens, integração com redes sociais, múltiplos servidores e muito mais.

Neste post, mostraremos como instalar a solução de hospedagem de imagens Chevereto no Ubuntu 22.04.

Pré-requisitos

  • Um servidor rodando Ubuntu 22.04.
  • Uma senha de root configurada no servidor.

Começando

Primeiro, é recomendado atualizar e fazer upgrade de todos os pacotes do seu sistema para a versão mais recente. Você pode atualizá-los executando o seguinte comando:

apt update -y  
apt upgrade -y

Uma vez que todos os pacotes estejam atualizados, execute o seguinte comando para instalar as dependências adicionais necessárias:

apt install apt-transport-https ca-certificates curl software-properties-common -y

Uma vez que todas as dependências estejam instaladas, você pode prosseguir para o próximo passo.

Instalar Apache, PHP e MariaDB Server.

Antes de começar, você precisará instalar o servidor LAMP no seu servidor.

Primeiro, instale o servidor Apache e MariaDB usando o seguinte comando:

apt install apache2 mariadb-server

Em seguida, adicione o repositório PHP ao APT com o seguinte comando:

add-apt-repository ppa:ondrej/php -y

Em seguida, instale a versão 7.4 do PHP com outras extensões necessárias usando o seguinte comando:

apt install php7.4 libapache2-mod-php7.4 php7.4-cli php7.4-fpm php7.4-json php7.4-mysql php7.4-zip php7.4-gd php7.4-mbstring php7.4-curl php7.4-xml php7.4-bcmath -y

Uma vez que todos os pacotes estejam instalados, você pode prosseguir para o próximo passo.

Criar um Banco de Dados MariaDB

Primeiro, proteja a instalação do MariaDB e defina uma senha de root executando o seguinte script:

mysql_secure_installation

Responda a todas as perguntas conforme mostrado abaixo:

Enter current password for root (enter for none): Press ENTER
Set root password? [Y/n]: Y
New password: Defina-sua-nova-senha
Re-enter new password: Defina-sua-nova-senha
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

Em seguida, faça login no MariaDB com o seguinte comando:

mysql -u root -p

Uma vez que você esteja logado, crie um banco de dados e um usuário com o seguinte comando:

MariaDB [(none)]> CREATE DATABASE chevereto;  
MariaDB [(none)]> CREATE USER 'chevereto'@'localhost' IDENTIFIED BY 'senha';

Em seguida, conceda todas as permissões ao banco de dados Chevereto com o seguinte comando:

MariaDB [(none)]> GRANT ALL PRIVILEGES ON chevereto.* TO 'chevereto'@'localhost';

Em seguida, limpe as permissões para aplicar as alterações:

MariaDB [(none)]> FLUSH PRIVILEGES;

Finalmente, saia do shell do MariaDB com o seguinte comando:

MariaDB [(none)]> EXIT;

Baixar Chevereto

Primeiro, crie um diretório para o Chevereto dentro do diretório raiz da web do Apache usando o seguinte comando:

mkdir -p /var/www/html/chevereto/

Em seguida, navegue até o diretório Chevereto e baixe a versão mais recente do Chevereto com o seguinte comando:

cd /var/www/html/chevereto  
wget https://github.com/rodber/chevereto-free/releases/download/1.6.0/1.6.0.zip

Uma vez que o download esteja completo, descompacte o arquivo baixado com o seguinte comando:

unzip 1.6.0.zip

Em seguida, defina as permissões e a propriedade adequadas para o diretório Chevereto:

chown -R www-data:www-data /var/www/html/chevereto/  
chmod -R 775 /var/www/html/chevereto/

Configurar o Apache para Chevereto

Em seguida, crie um arquivo de configuração de host virtual do Apache para o Chevereto usando o seguinte comando:

nano /etc/apache2/sites-available/chevereto.conf

Adicione as seguintes configurações:



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

ErrorLog ${APACHE_LOG_DIR}/chevereto.example.com_error.log
CustomLog ${APACHE_LOG_DIR}/chevereto.example.com_access.log combined


Options FollowSymlinks
AllowOverride All
Require all granted



Salve e feche o arquivo quando terminar. Em seguida, ative o host virtual Chevereto com o seguinte comando:

a2ensite chevereto.conf

Em seguida, habilite o módulo de reescrita do Apache e o módulo SSL com o seguinte comando:

a2enmod rewrite ssl

Finalmente, reinicie o serviço Apache para aplicar as alterações:

systemctl restart apache2

Você também pode verificar o status do Apache com o seguinte comando:

systemctl status apache2

Você deve ver a seguinte saída:

? apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2022-08-28 07:22:12 UTC; 9s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 87027 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 87032 (apache2)
      Tasks: 6 (limit: 2242)
     Memory: 14.1M
        CPU: 111ms
     CGroup: /system.slice/apache2.service
             ??87032 /usr/sbin/apache2 -k start
             ??87033 /usr/sbin/apache2 -k start
             ??87034 /usr/sbin/apache2 -k start
             ??87035 /usr/sbin/apache2 -k start
             ??87036 /usr/sbin/apache2 -k start
             ??87037 /usr/sbin/apache2 -k start

Aug 28 07:22:12 ubuntu2204 systemd[1]: Starting The Apache HTTP Server...

Acessar a Interface Web do Chevereto

Agora, abra seu navegador e acesse a interface web do Chevereto usando a URL http://chevereto.example.com. Você será redirecionado para a página de configuração do banco de dados:

Configuração do banco de dados

Forneça suas informações de banco de dados e clique no botão Continuar. Você deve ver a seguinte página:

Instalar Chevereto

Detalhes do email

Agora, forneça seu nome de usuário de administrador, senha e modo do site, em seguida, clique no botão Instalar Chevereto. Uma vez que a instalação tenha sido concluída, você deve ver a seguinte página:

Instalação do Chevereto concluída com sucesso

Clique no botão painel de administração. Você deve ver a página de login do Chevereto:

Login

Forneça seu nome de usuário de administrador, senha e clique no botão = >. Você deve ver o painel do Chevereto na seguinte página:

Painel do Chevereto

Proteger o Chevereto com SSL Let’s Encrypt

Também é recomendado proteger seu site com SSL Let’s Encrypt. Primeiro, você precisará instalar o cliente Certbot no seu servidor. Você pode instalá-lo com o seguinte comando:

apt-get install python3-certbot-apache -y

Uma vez que o Certbot esteja instalado, execute o seguinte comando para proteger seu site com SSL Let’s Encrypt:

certbot --apache -d chevereto.example.com

Você será solicitado a fornecer seu email e aceitar os termos de serviço conforme mostrado abaixo:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
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-v02.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 our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Plugins selected: Authenticator apache, Installer apache
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for chevereto.example.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/chevereto-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/chevereto-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/chevereto-le-ssl.conf
Next, select whether or not to redirect HTTP traffic to HTTPS as shown below:

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

Digite 2 e pressione Enter para instalar o SSL Let’s Encrypt para seu site:

Enabled Apache rewrite module
Redirecting vhost in /etc/apache2/sites-enabled/chevereto.conf to ssl vhost in /etc/apache2/sites-available/chevereto-le-ssl.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://chevereto.example.com

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=chevereto.example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/chevereto.example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/chevereto.example.com/privkey.pem
   Your cert will expire on 2022-11-29. 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"
 - 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

Conclusão

Parabéns! você instalou com sucesso o servidor de hospedagem de imagens Chevereto no Ubuntu 22.04. Agora você pode enviar suas imagens para o servidor e acessá-las de qualquer lugar na web. Sinta-se à vontade para me perguntar se você tiver alguma dúvida.

Share: X/Twitter LinkedIn

Receba novas postagens na sua caixa de entrada

Sem spam. Cancele a assinatura a qualquer momento.