systemctl は Linux のサービスを操作するコマンドです。`status` の読み方、`start` と `enable` の違い、動いているサービスの一覧の見方を、ブラウザ上のターミナルで打ちながら確認できます。
最終更新: 2026-09-07
systemctl サブコマンド サービス名
サービス(常駐して動き続けるプログラム)を操作します。
まずは状態の確認からです。
$ systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; disabled; vendor preset: enabled)
Active: inactive (dead) since Mon 2026-03-23 08:00:00 UTC; 2h ago
読むのは2行です。
| 行 | 意味 |
|---|---|
Loaded | 設定が読み込まれているか。disabled は次の起動では動かない |
Active | いま動いているか。inactive (dead) は止まっている |
いまは止まっていて、自動起動も無効、という状態です。
止まっているので起動します。 サービスの操作には管理者の権限が要ります。
$ systemctl restart nginx
Failed to restart nginx.service: Interactive authentication required.
See system logs and 'systemctl status nginx.service' for details.
$ sudo systemctl start nginx
$ systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; disabled; vendor preset: enabled)
Active: active (running) since Mon 2026-03-23 08:00:00 UTC; 2h ago
Main PID: 1001 (nginx)
Tasks: 2 (limit: 4915)
Memory: 2.3M
CGroup: /system.slice/nginx.service
└─1001 /usr/sbin/nginx
active (running) になり、プロセス番号(Main PID)も出ました。
状態だけを知りたいときは is-active のほうが短く済みます。
$ systemctl is-active nginx
active
ここが systemctl でいちばん混乱するところです。
start で動かしても、自動起動は無効のままです。
$ systemctl is-enabled nginx
disabled
サーバーを再起動しても動いていてほしいなら、enable が要ります。
$ sudo systemctl enable nginx
Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /lib/systemd/system/nginx.service.
$ systemctl is-enabled nginx
enabled
| サブコマンド | いま | 次の起動から |
|---|---|---|
start | 動かす | 変わらない |
stop | 止める | 変わらない |
enable | 変わらない | 動かす |
disable | 変わらない | 動かさない |
「動かしたのに再起動したら消えた」は、enable を忘れたときの症状です。
$ systemctl list-units --type=service
UNIT LOAD ACTIVE SUB DESCRIPTION
nginx.service loaded active running A high performance web server and a reverse proxy server
ssh.service loaded active running OpenBSD Secure Shell server
cron.service loaded active running Regular background program processing daemon
networking.service loaded active running Raise network interfaces
systemd-resolved.service loaded active running Network Name Resolution
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
5 loaded units listed. Pass --all to see loaded but inactive units, too.
既定では動いているものだけが出ます。
止まっているものも含めて見たいときは --all を付けます。
$ sudo systemctl stop nginx
$ systemctl is-active nginx
inactive
systemctl は、動いているはずのものが動いていないときに最初に打つコマンドです。
| 場面 | 打ち方 |
|---|---|
| 動いているか確かめる | systemctl status nginx |
| 設定を変えたので反映する | sudo systemctl restart nginx |
| 接続を切らずに設定を読み直す | sudo systemctl reload nginx |
| 再起動後も動くようにする | sudo systemctl enable nginx |
| 失敗した理由を読む | journalctl -u nginx |
status で状態を見て、journalctl で理由を読む。
この2つを組で覚えると、サーバーの障害対応はだいたい進みます。
start と enable は別物です。
start だけだと、サーバーを再起動した瞬間に止まったままになります。
両方必要なときは sudo systemctl enable --now nginx と書けます。
サービス名は .service を省略できます。
nginx と nginx.service は同じ意味です。
存在しない名前を渡すと、そう言われます。
$ systemctl status nosuchservice
Unit nosuchservice.service could not be found.
status は要約です。
起動に失敗した理由まではここに出ません。
journalctl -u nginx でログ本体を読んでください。
webterm.appこのサイト
ターミナル応用
特定場面で役立つコマンドを学ぶ
learn.webterm.app別のサイト

journalctl / sudo / ps / kill