Shopwareインストール · 6 min read · Nov 11, 2025
CentOS 8にNGINXとLet's EncryptでShopware 6をインストールする方法

Shopwareは、オンラインビジネスを支える独自のeコマースウェブサイトを始めるための無料でオープンソースのプラットフォームです。完全にレスポンシブなオンラインストアを構築し、カスタマイズするのに役立つ多くの便利なツールを提供します。Magentoに非常に似ていますが、Shopwareは非常に強力で、使いやすく、柔軟なアプリケーションです。モダンなユーザーインターフェースを使用して、どのデバイスからでもコンテンツや製品を簡単に作成および管理できます。
このチュートリアルでは、CentOS 8にNginxとLet’s Encrypt SSLを使用してShopwareをインストールする方法を示します。
前提条件
- CentOS 8を実行しているサーバー。
- サーバーIPにポイントされた有効なドメイン名。
- サーバーに設定されたルートパスワード。
LEMPサーバーのインストール
ShopwareはWebサーバー上で動作し、PHP、Symfony、Zendコンポーネントで構築され、MySQLまたはMariaDBをデータベースバックエンドとして使用します。したがって、サーバーにNginx、MariaDB、PHPおよびその他の拡張機能をインストールする必要があります。次のコマンドでこれらすべてをインストールできます:
dnf install nginx mariadb-server php php-cli php-intl php-fpm php-common php-mysqli php-curl php-json php-zip php-gd php-xml php-mbstring php-opcache unzip -yすべてのパッケージがインストールされたら、次のコマンドでNginx、MariaDB、およびPHP-FPMサービスを起動し、システム再起動時に自動的に起動するように設定します:
systemctl start mariadb
systemctl enable mariadb
systemctl start nginx
systemctl start php-fpm
systemctl enable nginx
systemctl enable php-fpm完了したら、次のステップに進むことができます。
PHP-FPMの設定
デフォルトでは、PHP-FPMはapacheユーザーおよびグループとして実行するように設定されています。したがって、Nginxユーザーおよびグループとして実行するように設定する必要があります。次のファイルを編集することで行えます:/etc/php-fpm.d/www.conf
nano /etc/php-fpm.d/www.conf次の行を変更します:
user = nginx
group = nginx ファイルを保存して閉じたら、セッションディレクトリを作成し、次のコマンドで適切な所有権を設定します:
mkdir -p /var/lib/php/session
chown -R nginx:nginx /var/lib/php/session次に、php.iniファイルを編集し、いくつかの推奨設定を調整します:
nano /etc/php.ini次の行を変更します:
memory_limit = 512M
upload_max_filesize = 20M
date.timezone = Asia/Kolkataファイルを保存して閉じたら、変更を適用するためにPHP-FPMサービスを再起動します:
systemctl restart php-fpmShopware用のデータベースを作成
次に、Shopware用のデータベースとユーザーを作成する必要があります。まず、次のコマンドを使用してMariaDBに接続します:
mysql接続したら、次のコマンドでデータベースとユーザーを作成します:
MariaDB [(none)]> CREATE DATABASE shopware;
MariaDB [(none)]> GRANT ALL ON shopware.* TO 'shopware' IDENTIFIED BY 'password';次に、特権をフラッシュし、次のコマンドでMariaDBから退出します:
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;完了したら、次のステップに進むことができます。
Shopwareをダウンロード
次に、公式ウェブサイトからShopwareの最新バージョンをダウンロードする必要があります。まず、Nginxのルートディレクトリ内にShopware用のディレクトリを作成します:
mkdir /var/www/html/shopware次に、次のコマンドでShopwareをダウンロードします:
wget https://www.shopware.com/en/Download/redirect/version/sw6/file/install_v6.3.5.0_ba08dbfc07784b5cefe7837f2abbda69dbf5b8b7.zip -O shopware.zipダウンロードが完了したら、ダウンロードしたファイルをshopwareディレクトリに抽出します:
unzip shopware.zip -d /var/www/html/shopware次に、次のコマンドで適切な権限と所有権を設定します:
chown -R nginx:nginx /var/www/html/shopware
chmod -R 775 /var/www/html/shopware完了したら、次のステップに進むことができます。
Shopware用のNginxの設定
次に、次のコマンドでShopware用のNginx仮想ホスト設定ファイルを作成します:
nano /etc/nginx/conf.d/shopware.conf次の行を追加します:
server {
listen 80;
# Handle / to index.php
index index.php;
# Our server name
server_name shopware.example.com;
# Where the code is located
root /var/www/html/shopware/public;
# Needed for Shopware install / update
location /recovery/install {
index index.php;
try_files $uri /recovery/install/index.php$is_args$args;
}
location /recovery/update/ {
if (!-e $request_filename){
rewrite . /recovery/update/index.php last;
}
}
# Forward any not found file to index.php. Also allows to have beautiful urls like /homemade-products/
location / {
try_files $uri /index.php$is_args$args;
}
# Let php-fpm handle .php files
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi.conf;
fastcgi_param HTTP_PROXY "";
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
fastcgi_read_timeout 300s;
client_body_buffer_size 128k;
fastcgi_pass unix:/run/php-fpm/www.sock;
http2_push_preload on;
}
}ファイルを保存して閉じたら、次のコマンドでNginxの構文エラーを確認します:
nginx -t次の出力が得られるはずです:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful次に、変更を適用するためにNginxサービスを再起動します:
systemctl restart nginx次のコマンドを使用してNginxのステータスを確認することもできます:
systemctl status nginx次の出力が得られるはずです:
? nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
Drop-In: /usr/lib/systemd/system/nginx.service.d
??php-fpm.conf
Active: active (running) since Tue 2021-02-02 00:40:04 EST; 19s ago
Process: 76059 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
Process: 76057 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
Process: 76054 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
Main PID: 76060 (nginx)
Tasks: 3 (limit: 12523)
Memory: 5.5M
CGroup: /system.slice/nginx.service
??76060 nginx: master process /usr/sbin/nginx
??76061 nginx: worker process
??76062 nginx: worker process
Feb 02 00:40:04 centos8 systemd[1]: Stopped The nginx HTTP and reverse proxy server.
Feb 02 00:40:04 centos8 systemd[1]: Starting The nginx HTTP and reverse proxy server...
Feb 02 00:40:04 centos8 nginx[76057]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Feb 02 00:40:04 centos8 nginx[76057]: nginx: configuration file /etc/nginx/nginx.conf test is successful
Feb 02 00:40:04 centos8 systemd[1]: Started The nginx HTTP and reverse proxy server.SELinuxとファイアウォールの設定
デフォルトでは、SELinuxはCentOS 8で有効になっています。したがって、ShopwareのSELinuxコンテキストを設定する必要があります。次のコマンドで設定できます:
setsebool httpd_can_network_connect on -P
chcon -R -u system_u -t httpd_sys_rw_content_t -r object_r /var/www/html/shopware次に、次のコマンドでfirewalldを介してポート80と443を許可します:
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload完了したら、次のステップに進むことができます。
Shopwareウェブインターフェースにアクセス
今、ウェブブラウザを開き、URL http://shopware.example.com を入力します。
言語を選択し、次へボタンをクリックします。すべての要件が満たされていることを確認し、次へボタンをクリックします。次のページが表示されるはずです:

GTCに同意し、次へボタンをクリックします。次のページが表示されるはずです:

データベース、ユーザー名、パスワードを提供し、インストールを開始ボタンをクリックします。インストールが完了すると、次のページが表示されるはずです:

次のページをクリックします。ショップ名、メールアドレス、通貨、国、管理者ユーザー名、パスワードを提供し、次へボタンをクリックします。Shopwareダッシュボードにリダイレクトされます:


すべての情報を提供し、次へボタンをクリックします。次のページが表示されるはずです:

希望する言語プラグインをインストールし、次へボタンをクリックします。次のページが表示されるはずです:

デモデータをインストールするか、これをスキップして次へボタンをクリックします。次のページが表示されるはずです:

後で設定をクリックします。次のページが表示されるはずです:

スキップボタンをクリックします。次のページが表示されるはずです:

次へボタンをクリックします。次のページが表示されるはずです:

スキップボタンをクリックします。次のページが表示されるはずです:

完了ボタンをクリックします。Shopwareのウェルカムページが表示されるはずです:

Let’s Encrypt SSLでShopwareを保護
次に、Certbotユーティリティをシステムにインストールして、Let’s Chatドメイン用にLet’s Encrypt SSLをダウンロードおよびインストールする必要があります。
次のコマンドでCertbotクライアントをインストールできます:
wget https://dl.eff.org/certbot-auto
mv certbot-auto /usr/local/bin/certbot-auto
chown root /usr/local/bin/certbot-auto
chmod 0755 /usr/local/bin/certbot-auto次に、次のコマンドでletsドメイン用のSSL証明書を取得してインストールします:
certbot-auto --nginx -d shopware.example.com上記のコマンドは、最初にサーバーに必要なすべての依存関係をインストールします。インストールが完了すると、メールアドレスを提供し、以下のようにサービス利用規約に同意するよう求められます:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
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
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for shopware.example.com
Waiting for verification...
Cleaning up challenges
Deploying Certificate to VirtualHost /etc/nginx/conf.d/shopware.conf次に、HTTPトラフィックをHTTPSにリダイレクトするかどうかを選択します:
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): 22を入力してEnterを押して続行します。インストールが完了すると、次の出力が表示されるはずです:
Redirecting all traffic on port 80 to ssl in /etc/nginx/conf.d/shopware.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://shopware.example.com
You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=shopware.example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/shopware.example.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/shopware.example.com/privkey.pem
Your cert will expire on 2021-04-2. To obtain a new or tweaked
version of this certificate in the future, simply run certbot-auto
again with the "certonly" option. To non-interactively renew *all*
of your certificates, run "certbot-auto 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これで、URL https://shopware.example.com を使用して安全にShopwareにアクセスできます。
結論
おめでとうございます!CentOS 8にNginxとLet’s Encrypt SSLを使用してShopwareを正常にインストールおよび設定しました。これで、Shopwareを使用して独自のオンラインストアを簡単にホストできます。質問があればお気軽にお尋ねください。
新しい投稿を受信箱で受け取る
スパムはありません。いつでも購読を解除できます。