画像ホスティング · 5 min read · Dec 29, 2025
Ubuntu 22.04でChevereto-Freeを使用して画像ホスティングウェブサイトを作成する

Cheveretoは、独自の画像ホスティングサーバーをウェブ上にホストできる無料のオープンソースの画像ホスティングおよび共有ソフトウェアです。これは、自己ホスト型の多目的でマルチユーザー対応のフル機能を備えた画像ホスティングソリューションで、レスポンシブな画像ホスティングウェブサイトを作成することができます。多言語対応、大量画像のインポート、ソーシャルメディア統合、複数のサーバーなど、多くの機能を提供しています。
この記事では、Ubuntu 22.04にChevereto画像ホスティングソリューションをインストールする方法を示します。
前提条件
- Ubuntu 22.04を実行しているサーバー。
- サーバーに設定されたルートパスワード。
始めに
まず、すべてのシステムパッケージを最新バージョンに更新およびアップグレードすることをお勧めします。次のコマンドを実行して更新できます:
apt update -y
apt upgrade -yすべてのパッケージがアップグレードされたら、次のコマンドを実行して追加の必要な依存関係をインストールします:
apt install apt-transport-https ca-certificates curl software-properties-common -yすべての依存関係がインストールされたら、次のステップに進むことができます。
Apache、PHP、およびMariaDBサーバーのインストール
始める前に、サーバーにLAMPサーバーをインストールする必要があります。
まず、次のコマンドを使用してApacheとMariaDBサーバーをインストールします:
apt install apache2 mariadb-server次に、次のコマンドを使用してAPTにPHPリポジトリを追加します:
add-apt-repository ppa:ondrej/php -y次に、次のコマンドを使用して他の必要な拡張機能とともにPHPバージョン7.4をインストールします:
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すべてのパッケージがインストールされたら、次のステップに進むことができます。
MariaDBデータベースの作成
まず、次のスクリプトを実行してMariaDBのインストールを保護し、ルートパスワードを設定します:
mysql_secure_installation以下のようにすべての質問に答えます:
Enter current password for root (enter for none): Press ENTER
Set root password? [Y/n]: Y
New password: Set-your-new-password
Re-enter new password: Set-your-new-password
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
次に、次のコマンドを使用してMariaDBにログインします:
mysql -u root -pログインしたら、次のコマンドを使用してデータベースとユーザーを作成します:
MariaDB [(none)]> CREATE DATABASE chevereto;
MariaDB [(none)]> CREATE USER 'chevereto'@'localhost' IDENTIFIED BY 'password';次に、次のコマンドを使用してCheveretoデータベースにすべての権限を付与します:
MariaDB [(none)]> GRANT ALL PRIVILEGES ON chevereto.* TO 'chevereto'@'localhost';次に、変更を適用するために権限をフラッシュします:
MariaDB [(none)]> FLUSH PRIVILEGES;最後に、次のコマンドを使用してMariaDBシェルから退出します:
MariaDB [(none)]> EXIT;Cheveretoのダウンロード
まず、次のコマンドを使用してApacheのウェブルートディレクトリ内にChevereto用のディレクトリを作成します:
mkdir -p /var/www/html/chevereto/次に、Cheveretoディレクトリに移動し、次のコマンドを使用してCheveretoの最新バージョンをダウンロードします:
cd /var/www/html/chevereto
wget https://github.com/rodber/chevereto-free/releases/download/1.6.0/1.6.0.zipダウンロードが完了したら、次のコマンドを使用してダウンロードしたファイルの解凍を行います:
unzip 1.6.0.zip次に、Cheveretoディレクトリに適切な権限と所有権を設定します:
chown -R www-data:www-data /var/www/html/chevereto/
chmod -R 775 /var/www/html/chevereto/Chevereto用のApacheの設定
次に、次のコマンドを使用してChevereto用のApache仮想ホスト設定ファイルを作成します:
nano /etc/apache2/sites-available/chevereto.conf以下の設定を追加します:
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
完了したらファイルを保存して閉じます。次に、次のコマンドを使用してChevereto仮想ホストを有効にします:
a2ensite chevereto.conf次に、次のコマンドを使用してApacheのリライトおよびSSLモジュールを有効にします:
a2enmod rewrite ssl最後に、次のコマンドを使用してApacheサービスを再起動し、変更を適用します:
systemctl restart apache2次のコマンドを使用してApacheのステータスを確認することもできます:
systemctl status apache2次の出力が表示されるはずです:
? 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...
Cheveretoウェブインターフェースにアクセス
今、ウェブブラウザを開き、URL http://chevereto.example.comを使用してCheveretoウェブインターフェースにアクセスします。データベース設定ページにリダイレクトされます:

データベース情報を提供し、続行ボタンをクリックします。次のページが表示されるはずです:


今、管理者のユーザー名、パスワード、ウェブサイトモードを提供し、Cheveretoをインストールボタンをクリックします。インストールが完了すると、次のページが表示されるはずです:

管理ダッシュボードボタンをクリックします。Cheveretoのログインページが表示されるはずです:

管理者のユーザー名、パスワードを提供し、=>ボタンをクリックします。次のページにCheveretoダッシュボードが表示されるはずです:

Let’s Encrypt SSLでCheveretoを保護
ウェブサイトをLet’s Encrypt SSLで保護することもお勧めします。まず、サーバーにCertbotクライアントをインストールする必要があります。次のコマンドを使用してインストールできます:
apt-get install python3-certbot-apache -yCertbotがインストールされたら、次のコマンドを実行してLet’s Encrypt SSLでウェブサイトを保護します:
certbot --apache -d chevereto.example.comメールアドレスを提供し、以下のようにサービス利用規約に同意するよう求められます:
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
2を入力してEnterを押すと、ウェブサイトにLet’s Encrypt SSLがインストールされます:
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
結論
おめでとうございます!Ubuntu 22.04にChevereto画像ホスティングサーバーを正常にインストールしました。これで、サーバーに画像をアップロードし、ウェブ上のどこからでもアクセスできるようになります。質問があればお気軽にお尋ねください。
新しい投稿を受信箱で受け取る
スパムはありません。いつでも購読を解除できます。