Grafana 설치 · 7 min read · Dec 08, 2025
Debian 11에 Grafana 8 모니터링 도구 설치하는 방법

Grafana는 다른 호스트의 메트릭을 모니터링하는 데 사용되는 무료 오픈 소스 데이터 시각화 도구입니다. Typescript와 Go로 작성되었으며 로그 및 데이터 그래프를 생성하고 편집하며 메트릭을 생성할 수 있습니다. Graphite, InfluxDB 또는 OpenTSDB와 같은 시계열 데이터베이스에서 그래프와 대시보드를 생성할 수 있으며, 이를 다른 사용자와 공유할 수 있습니다.
기능
- 대시보드 템플릿
- 프로비저닝 주석
- 키오스크 모드 및 재생 목록
- 사용자 정의 플러그인
- 알림 및 알림 후크
이 게시물에서는 Debian 11에 Grafana 8을 설치하는 방법을 보여줍니다.
전제 조건
- Debian 11을 실행하는 서버.
- 서버 IP가 지정된 유효한 도메인 이름.
- 서버에 구성된 루트 비밀번호.
시작하기
시작하기 전에 시스템을 최신 버전으로 업데이트하는 것이 좋습니다. 다음 명령을 사용하여 모든 패키지를 업데이트할 수 있습니다:
apt-get update -y모든 패키지를 업데이트한 후, 다음 명령을 사용하여 필요한 다른 종속성을 설치합니다:
apt-get install gnupg2 curl wget git software-properties-common -y모든 패키지가 설치되면 다음 단계로 진행할 수 있습니다.
Grafana 8 설치
기본적으로 Grafana는 Debian 11 기본 저장소에 포함되어 있지 않습니다. 따라서 Grafana 저장소를 APT에 추가해야 합니다. 다음 명령을 사용하여 추가할 수 있습니다:
curl https://packages.grafana.com/gpg.key | apt-key add -
add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"저장소가 추가되면 저장소 캐시를 업데이트하고 다음 명령을 사용하여 Grafana를 설치합니다:
apt-get update -y
apt-get install grafana -yGrafana가 설치되면 다음 명령을 사용하여 Grafana 서비스를 시작하고 활성화합니다:
systemctl start grafana-server
systemctl enable grafana-server다음 명령을 사용하여 Grafana 서비스의 상태를 확인할 수도 있습니다:
systemctl status grafana-server다음과 같은 출력을 받을 수 있습니다:
? grafana-server.service - Grafana instance
Loaded: loaded (/lib/systemd/system/grafana-server.service; disabled; vendor preset: enabled)
Active: active (running) since Fri 2022-02-04 04:08:25 UTC; 5s ago
Docs: http://docs.grafana.org
Main PID: 8602 (grafana-server)
Tasks: 9 (limit: 2341)
Memory: 29.6M
CPU: 1.299s
CGroup: /system.slice/grafana-server.service
??8602 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --pidfile=/run/grafana/grafana-server.pid --packaging=deb cfg:>
Feb 04 04:08:27 debian11 grafana-server[8602]: t=2022-02-04T04:08:27+0000 lvl=info msg="migrations completed" logger=migrator performed=381 s>
Feb 04 04:08:27 debian11 grafana-server[8602]: t=2022-02-04T04:08:27+0000 lvl=info msg="Created default admin" logger=sqlstore user=admin
Feb 04 04:08:27 debian11 grafana-server[8602]: t=2022-02-04T04:08:27+0000 lvl=info msg="Created default organization" logger=sqlstore
Feb 04 04:08:27 debian11 grafana-server[8602]: t=2022-02-04T04:08:27+0000 lvl=info msg="Initialising plugins" logger=plugin.manager
Feb 04 04:08:27 debian11 grafana-server[8602]: t=2022-02-04T04:08:27+0000 lvl=info msg="Plugin registered" logger=plugin.manager pluginId=inp>
Feb 04 04:08:27 debian11 grafana-server[8602]: t=2022-02-04T04:08:27+0000 lvl=info msg="Live Push Gateway initialization" logger=live.push_ht>
Feb 04 04:08:27 debian11 grafana-server[8602]: t=2022-02-04T04:08:27+0000 lvl=info msg="Writing PID file" logger=server path=/run/grafana/gra>
Feb 04 04:08:27 debian11 grafana-server[8602]: t=2022-02-04T04:08:27+0000 lvl=info msg="HTTP Server Listen" logger=http.server address=[::]:3>
Feb 04 04:08:27 debian11 grafana-server[8602]: t=2022-02-04T04:08:27+0000 lvl=info msg="warming cache for startup" logger=ngalert
Feb 04 04:08:27 debian11 grafana-server[8602]: t=2022-02-04T04:08:27+0000 lvl=info msg="starting MultiOrg Alertmanager" logger=ngalert.multio>기본적으로 Grafana는 포트 3000에서 수신 대기합니다. 다음 명령을 사용하여 확인할 수 있습니다:
ss -antpl | grep 3000다음과 같은 출력을 받을 수 있습니다:
LISTEN 0 4096 *:3000 *:* users:(("grafana-server",pid=8602,fd=8)) Grafana를 위한 리버스 프록시로 Nginx 설치
다음으로, Grafana를 위한 리버스 프록시로 Nginx를 설치하고 구성해야 합니다. 먼저, 다음 명령을 사용하여 Nginx를 설치합니다:
apt-get install nginx -yNginx가 설치되면, 다음 명령을 사용하여 Nginx 가상 호스트 구성 파일을 생성합니다:
nano /etc/nginx/conf.d/grafana.conf다음 줄을 추가합니다:
server {
server_name grafana.example.com;
listen 80;
access_log /var/log/nginx/grafana.log;
location / {
proxy_pass http://localhost:3000;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}작업이 끝나면 파일을 저장하고 닫습니다. 그런 다음, 다음 명령을 사용하여 Nginx의 구문 오류를 확인합니다:
ginx -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 - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2022-02-04 04:09:20 UTC; 4s ago
Docs: man:nginx(8)
Process: 8631 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 8632 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Main PID: 8633 (nginx)
Tasks: 2 (limit: 2341)
Memory: 2.5M
CPU: 35ms
CGroup: /system.slice/nginx.service
??8633 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
??8634 nginx: worker process
Feb 04 04:09:20 debian11 systemd[1]: Starting A high performance web server and a reverse proxy server...
Feb 04 04:09:20 debian11 systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Feb 04 04:09:20 debian11 systemd[1]: Started A high performance web server and a reverse proxy server.이 시점에서 Nginx가 설치되고 Grafana를 위한 리버스 프록시로 구성되었습니다. 이제 다음 단계로 진행할 수 있습니다.
Grafana 대시보드에 접근하기
이제 웹 브라우저를 열고 http://grafana.example.com URL을 사용하여 Grafana 웹 인터페이스에 접근합니다. Grafana 로그인 페이지로 리디렉션됩니다:

관리자 사용자 이름과 비밀번호를 입력하고 로그인 버튼을 클릭합니다. Grafana 비밀번호 재설정 화면이 표시됩니다:

새 비밀번호를 설정하고 제출 버튼을 클릭합니다. 다음 화면에서 Grafana 대시보드를 볼 수 있습니다:

Let’s Encrypt로 Grafana 보안 설정
다음으로, Let’s Encrypt SSL을 설치하고 관리하기 위해 Certbot 클라이언트 패키지를 설치해야 합니다.
먼저, 다음 명령을 사용하여 Certbot을 설치합니다:
apt-get install certbot python3-certbot-nginx -y설치가 완료되면, 다음 명령을 실행하여 웹사이트에 Let’s Encrypt SSL을 설치합니다:
certbot --nginx -d grafana.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 grafana.example.com
Waiting for verification...
Cleaning up challenges
Deploying Certificate to VirtualHost /etc/nginx/conf.d/grafana.conf다음으로, HTTP 트래픽을 HTTPS로 리디렉션할지 여부를 선택하라는 메시지가 표시됩니다:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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/grafana.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://grafana.example.com
You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=grafana.example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/grafana.example.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/grafana.example.com/privkey.pem
Your cert will expire on 2022-05-07. 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"
- Your account credentials have been saved in your Certbot
configuration directory at /etc/letsencrypt. You should make a
secure backup of this folder now. This configuration directory will
also contain certificates and private keys obtained by Certbot so
making regular backups of this folder is ideal.
- 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
- We were unable to subscribe you the EFF mailing list because your
e-mail address appears to be invalid. You can try again later by
visiting https://act.eff.org.결론
축하합니다! Debian 11에 Nginx 및 Let’s Encrypt SSL과 함께 Grafana 8을 성공적으로 설치했습니다. 이제 원격 호스트를 추가하고 Grafana 대시보드에서 모니터링을 시작할 수 있습니다. 질문이 있으면 언제든지 문의해 주세요.
새 게시물을 받은 편지함에서 받기
스팸은 없습니다. 언제든지 구독 해지 가능합니다.