LoginSignup
12
7

More than 3 years have passed since last update.

UbuntuにNginxをインストールする

Last updated at Posted at 2019-07-31

Ubuntuのパッケージを使用する場合

$ sudo apt install -y nginx

簡単だがnginxのバージョンが少し古い

Nginxのパッケージを使用する場合

# NGINXリポジトリを信頼するための認証キーのダウンロード
$ wget https://nginx.org/keys/nginx_signing.key

# 認証キーのインポート
$ apt-key add nginx_signing.key
  ↑ エラーになる場合は以下のパッケージをインストール
  $ apt install -y gnupg

# 公式リポジトリの URL を Ubuntu に登録
$ vi /etc/apt/sources.list

以下を追記
deb http://nginx.org/packages/ubuntu/ bionic nginx
deb-src http://nginx.org/packages/ubuntu/ bionic nginx

# 設定変更を反映
$ apt update

# インストール
$ apt install -y nginx

最新のバージョンをインストールできる

12
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
7