docs: Updates installation instruction for Debian/Ubuntu (#64232)

* draft changes

* Apply suggestions from code review

Co-authored-by: Dan Cech <dcech@grafana.com>

* reworks debian/ubuntu instructions, updates start server topic

* Apply suggestions from code review

Co-authored-by: Dan Cech <dcech@grafana.com>

* incorporates feedback; restructures to align with writers toolkit guidelines

* Apply suggestions from code review

Co-authored-by: Dan Cech <dcech@grafana.com>

* tweaks structure of server topic; renames directory, corrects relrefs

* corrects spelling

* Apply suggestions from code review

Co-authored-by: Dan Cech <dcech@grafana.com>

* removed web parameter

* removes unnecessary word

* incorporates feedback from internal reviewer

* updates alias

* updates alias

* adjust alias

---------

Co-authored-by: Dan Cech <dcech@grafana.com>
This commit is contained in:
Christopher Moyer 2023-03-22 12:41:17 -05:00 committed by GitHub
parent b90aed4fd7
commit 13af5afaf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 308 additions and 255 deletions

View File

@ -103,7 +103,7 @@ GF_SERVER_ROOT_URL=https://grafana.example.com/
### Step 4. Restart Grafana
To finalize the installation of Grafana Enterprise, restart Grafana to enable all Grafana Enterprise features. Refer to [restart Grafana]({{< relref "../../setup-grafana/restart-grafana/" >}}) for more information.
To finalize the installation of Grafana Enterprise, restart Grafana to enable all Grafana Enterprise features. Refer to [restart Grafana]({{< relref "../../setup-grafana/start-restart-grafana/" >}}) for more information.
## License expiration
@ -125,7 +125,7 @@ If your license has expired, most of Grafana keeps working as normal. Some enter
2. Log in to your [Grafana Cloud Account](/login) and make sure you're in the correct organization in the dropdown at the top of the page.
3. Under the **Grafana Enterprise** section in the menu bar to the left, choose licenses and download the currently valid license with which you want to run Grafana. If you cannot see a valid license on Grafana.com, please contact your account manager at Grafana Labs to renew your subscription.
4. Replace the current `license.jwt`-file with the one you've just downloaded.
5. [Restart Grafana]({{< relref "../../setup-grafana/restart-grafana/" >}}).
5. [Restart Grafana]({{< relref "../../setup-grafana/start-restart-grafana/" >}}).
### If your license expires

View File

@ -121,6 +121,6 @@ To restart Grafana on a Kubernetes cluster,
1. After you update the service, navigate to your Grafana instance, sign in with Grafana Admin credentials, and navigate to the Statistics and Licensing page to validate that your license is active.
For more information about restarting Grafana, refer to [Restart Grafana]({{< relref "../../../../setup-grafana/restart-grafana/" >}}).
For more information about restarting Grafana, refer to [Restart Grafana]({{< relref "../../../../setup-grafana/start-restart-grafana/" >}}).
> If you experience issues when you update the EKS cluster, refer to [Amazon EKS troubleshooting](https://docs.aws.amazon.com/eks/latest/userguide/troubleshooting.html).

View File

@ -127,4 +127,4 @@ Choose one of the following options to update the [license_validation_type]({{<
To activate Grafana Enterprise features, start (or restart) Grafana.
For information about restarting Grafana, refer to [Restart Grafana]({{< relref "../../../../setup-grafana/restart-grafana/" >}}).
For information about restarting Grafana, refer to [Restart Grafana]({{< relref "../../../../setup-grafana/start-restart-grafana/" >}}).

View File

@ -3,31 +3,22 @@ aliases:
- ../../installation/debian/
- ../../installation/installation/debian/
description: Install guide for Grafana on Debian or Ubuntu
title: Install on Debian or Ubuntu
title: Install Grafana on Debian or Ubuntu
menutitle: Debian or Ubuntu
weight: 100
---
# Install on Debian or Ubuntu
# Install Grafana on Debian or Ubuntu
This page explains how to install Grafana dependencies, download and install Grafana, get the service up and running on your Debian or Ubuntu system, and also describes the installation package details.
This topic explains how to install Grafana dependencies, install Grafana on Linux Debian or Ubuntu, and start the Grafana server on your Debian or Ubuntu system.
## Repository migration (November 8th 2022)
There are multiple ways to install Grafana: using the Grafana Labs APT repository, by downloading a `.deb` package, or by downloading a binary `.tar.gz` file. Choose only one of the methods below that best suits your needs.
From that date, Grafana packages will be served from a new repository (<packages.grafana.com/deb/{product}> -> <apt.grafana.com>). The new repository serves, from a single APT configuration, all Grafana OSS products, as well as Grafana Enterprise.
> **Note:** If you install via the `.deb` package or `.tar.gz` file, then you must manually update Grafana for each new version.
The old URLs will still work, serving the content from the new repository, but you may encounter warnings about some repository attributes changing (e.g. `Origin` and `Label`).
## Install from APT repository
## Note on upgrading
While the process for upgrading Grafana is very similar to installing Grafana, there are some key backup steps you should perform. Read [Upgrading Grafana]({{< relref "../../../upgrade-guide/" >}}) for tips and guidance on updating an existing installation.
## 1. Download and install
You can install Grafana using our official APT repository, by downloading a `.deb` package, or by downloading a binary `.tar.gz` file.
### Install from APT repository
If you install from the APT repository, then Grafana is automatically updated every time you run `apt-get update`.
If you install from the APT repository, Grafana automatically updates when you run `apt-get update`.
| Grafana Version | Package | Repository |
| ------------------------- | ------------------ | ------------------------------------- |
@ -38,132 +29,130 @@ If you install from the APT repository, then Grafana is automatically updated ev
> **Note:** Grafana Enterprise is the recommended and default edition. It is available for free and includes all the features of the OSS edition. You can also upgrade to the [full Enterprise feature set](https://grafana.com/products/enterprise/?utm_source=grafana-install-page), which has support for [Enterprise plugins](https://grafana.com/grafana/plugins/?enterprise=1&utcm_source=grafana-install-page).
#### To install the latest release:
Complete the following steps to install Grafana from the APT repository:
```bash
sudo apt-get install -y apt-transport-https
sudo apt-get install -y software-properties-common wget
sudo wget -q -O /usr/share/keyrings/grafana.key https://apt.grafana.com/gpg.key
```
1. To install required packages and download the Grafana repository signing key, run the following commands:
Add this repository for stable releases:
```bash
sudo apt-get install -y apt-transport-https
sudo apt-get install -y software-properties-common wget
sudo wget -q -O /usr/share/keyrings/grafana.key https://apt.grafana.com/gpg.key
```
```bash
echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
```
1. To add a repository for stable releases, run the following command:
Add this repository if you want beta releases:
```bash
echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
```
```bash
echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com beta main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
```
1. To add a repository for beta releases, run the following command:
After you add the repository:
```bash
echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com beta main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
```
```bash
sudo apt-get update
1. After you add the repository, run the following commands to install the OSS or Enterprise release:
# Install the latest OSS release:
sudo apt-get install grafana
```bash
# Update the list of available packages
sudo apt-get update
# Install the latest Enterprise release:
sudo apt-get install grafana-enterprise
```
# Install the latest OSS release:
sudo apt-get install grafana
### Install .deb package
# Install the latest Enterprise release:
sudo apt-get install grafana-enterprise
```
If you install the `.deb` package, then you will need to manually update Grafana for each new version.
## Install Grafana using a deb package or as a standalone binary
1. On the [Grafana download page](https://grafana.com/grafana/download), select the Grafana version you want to install.
If you choose not to install Grafana using APT, you can download and install Grafana using the deb package or as a standalone binary.
Complete the following steps to install Grafana using DEB or the standalone binaries:
1. Navigate to the [Grafana download page](https://grafana.com/grafana/download).
1. Select the Grafana version you want to install.
- The most recent Grafana version is selected by default.
- The **Version** field displays only finished releases. If you want to install a beta version, click **Nightly Builds** and then select a version.
- The **Version** field displays only tagged releases. If you want to install a nightly build, click **Nightly Builds** and then select a version.
1. Select an **Edition**.
- **Enterprise** - Recommended download. Functionally identical to the open source version, but includes features you can unlock with a license if you so choose.
- **Open Source** - Functionally identical to the Enterprise version, but you will need to download the Enterprise version if you want Enterprise features.
1. Depending on which system you are running, click **Linux** or **ARM**.
1. Copy and paste the code from the installation page into your command line and run. It follows the pattern shown below.
```bash
sudo apt-get install -y adduser
wget <.deb package url>
sudo dpkg -i grafana<edition>_<version>_amd64.deb
```
## Install from binary .tar.gz file
Download the latest [`.tar.gz` file](https://grafana.com/grafana/download?platform=linux) and extract it. The files extract into a folder named after the Grafana version downloaded. This folder contains all files required to run Grafana. There are no init scripts or install scripts in this package.
```bash
wget <tar.gz package url>
sudo tar -zxvf <tar.gz package>
```
- **Enterprise:** This is the recommended version. It is functionally identical to the open source version, but includes features you can unlock with a license, if you so choose.
- **Open Source:** This version is functionally identical to the Enterprise version, but you will need to download the Enterprise version if you want Enterprise features.
1. Depending on which system you are running, click the **Linux** or **ARM** tab on the download page.
1. Copy and paste the code from the installation page into your command line and run.
## 2. Start the server
This starts the `grafana-server` process as the `grafana` user, which was created during the package installation.
The following sections provide instructions for starting the `grafana-server` process as the `grafana` user, which was created during the package installation.
If you installed with the APT repository or `.deb` package, then you can start the server using `systemd` or `init.d`. If you installed a binary `.tar.gz` file, then you need to execute the binary.
### Start the server with systemd
> **Note:** The following subsections describe three methods of starting the Grafana server: with systemd, initd, or by directly running the binary. You should follow only one set of instructions, depending on how your machine is configured.
To start the service and verify that the service has started:
### Start the Grafana server with systemd
```bash
sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl status grafana-server
```
Complete the following steps to start the Grafana server with systemd and verify that it is running:
Configure the Grafana server to start at boot:
1. To start the service, run the following commands:
```bash
sudo systemctl enable grafana-server.service
```
```bash
sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl status grafana-server
```
#### Serving Grafana on a port < 1024
1. To verify that the service is running, run the following command:
```
sudo systemctl status grafana-server
```
1. To configure the Grafana server to start at boot, run the following command:
```bash
sudo systemctl enable grafana-server.service
```
#### Serve Grafana on a port < 1024
{{< docs/shared "systemd/bind-net-capabilities.md" >}}
### Start the server with init.d
To start the service and verify that the service has started:
Complete the following steps to start the Grafana service and verify that it is running:
```bash
sudo service grafana-server start
sudo service grafana-server status
```
1. To start the Grafana server, run the following commands:
Configure the Grafana server to start at boot:
```bash
sudo service grafana-server start
sudo service grafana-server status
```
```bash
sudo update-rc.d grafana-server defaults
```
1. To verify that the service is running, run the following command:
### Execute the binary
```
sudo service grafana-server status
```
1. To configure the Grafana server to start at boot, run the following command:
```bash
sudo update-rc.d grafana-server defaults
```
### Start the server using the binary
The `grafana-server` binary .tar.gz needs the working directory to be the root install directory where the binary and the `public` folder are located.
Start Grafana by running:
To start the Grafana server, run the following command:
```bash
./bin/grafana-server web
./bin/grafana-server
```
## Package details
## Upgrade Grafana
- Installs binary to `/usr/sbin/grafana-server`
- Installs Init.d script to `/etc/init.d/grafana-server`
- Creates default file (environment vars) to `/etc/default/grafana-server`
- Installs configuration file to `/etc/grafana/grafana.ini`
- Installs systemd service (if systemd is available) name `grafana-server.service`
- The default configuration sets the log file at `/var/log/grafana/grafana.log`
- The default configuration specifies a SQLite3 db at `/var/lib/grafana/grafana.db`
- Installs HTML/JS/CSS and other Grafana files at `/usr/share/grafana`
While the process for upgrading Grafana is similar to installing Grafana, there are important backup tasks you should perform. Refer to [Upgrade Grafana]({{< relref "../../../upgrade-guide/" >}}) for guidance on updating an existing installation.
## Next steps
Refer to the [Getting Started]({{< relref "../../../getting-started/build-first-dashboard/" >}}) guide for information about logging in, setting up data sources, and so on.
## Configure Grafana
Refer to the [Configuration]({{< relref "../../configure-grafana/" >}}) page for details on options for customizing your environment, logging, database, and so on.
- [Start the Grafana server]({{< relref "../../start-restart-grafana/" >}})

View File

@ -33,8 +33,8 @@ You install Grafana using the Windows installer or using the standalone Windows
c. Extract the ZIP file to any folder.
1. Start Grafana by executing `grafana-server.exe`, located in the `bin` directory, preferably from the command line. If you want to run Grafana as a Windows service, then download
[NSSM](https://nssm.cc/). It is very easy to add Grafana as a Windows service using that tool.
Start Grafana by executing `grafana-server.exe`, located in the `bin` directory, preferably from the command line. If you want to run Grafana as a Windows service, then download
[NSSM](https://nssm.cc/). It is very easy to add Grafana as a Windows service using that tool.
1. To run Grafana, open your browser and go to the Grafana port (http://localhost:3000/ is default) and then follow the instructions in [Getting Started]({{< relref "../../../getting-started/build-first-dashboard/" >}}).

View File

@ -1,132 +0,0 @@
---
aliases:
- ../installation/restart-grafana/
description: Instructions for restarting Grafana
title: Restart Grafana
weight: 300
---
# Restart Grafana
Users often need to restart Grafana after they have made configuration changes. This topic provides detailed instructions on how to restart Grafana supported operating systems.
- [Windows](#windows)
- [MacOS](#macos)
- [Linux](#linux)
- [Docker](#docker)
## Windows
To restart Grafana:
1. Open the Services app.
1. Right-click on the **Grafana** service.
1. In the context menu, click **Restart**.
## macOS
Restart methods differ depending on whether you installed Grafana using Homebrew or as standalone macOS binaries.
### Restart Grafana using Homebrew
Use the [Homebrew](http://brew.sh/) restart command:
```bash
brew services restart grafana
```
### Restart standalone macOS binaries
To restart Grafana:
1. Open a terminal and go to the directory where you copied the install setup files.
1. Run the command:
```bash
./bin/grafana-server web
```
## Linux
Restart methods differ depending on whether your Linux system uses `systemd` or `init.d`.
### Restart the server with systemd
To restart the service and verify that the service has started, run the following commands:
```bash
sudo systemctl restart grafana-server
sudo systemctl status grafana-server
```
Alternately, you can configure the Grafana server to restart at boot:
```bash
sudo systemctl enable grafana-server.service
```
> **Note:** SUSE or OpenSUSE users may need to start the server with the systemd method, then use the init.d method to configure Grafana to start at boot.
### Restart the server with init.d
To restart the service, run the following command:
```bash
sudo service grafana-server restart
```
or
```bash
sudo /etc/init.d/grafana-server restart
```
Verify the status:
```bash
sudo service grafana-server status
```
or
```bash
sudo /etc/init.d/grafana-server status
```
Alternately, you can configure the Grafana server to restart at boot:
```bash
sudo update-rc.d grafana-server defaults
```
## Docker
To restart the Grafana service, use the `docker restart` command.
`docker restart grafana`
Alternately, you can use the `docker compose restart` command to restart Grafana. For more information, refer to [docker compose documentation](https://docs.docker.com/compose/).
### Docker compose example
Configure your `docker-compose.yml` file. For example:
```bash
grafana:
image: grafana/grafana:latest
ports:
- "3000:3000"
environment:
- TERM=linux
- GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-piechart-panel,grafana-polystat-panel
```
Start the Grafana server:
`docker-compose up`
This starts the Grafana server along with the three plugins specified in the YAML file.
To restart the running container, use this command:
`docker-compose restart grafana`

View File

@ -0,0 +1,194 @@
---
aliases:
- ../installation/restart-grafana/
- ./restart-grafana/
description: How to start the Grafana server
title: Start the Grafana server
menuTitle: Start Grafana
weight: 300
---
# Start the Grafana server
This topic includes instructions for starting the Grafana server. For certain configuration changes, you might have to restart the Grafana server for them to take effect.
The following instructions start the `grafana-server` process as the `grafana` user, which was created during the package installation.
If you installed with the APT repository or `.deb` package, then you can start the server using `systemd` or `init.d`. If you installed a binary `.tar.gz` file, then you execute the binary.
## Linux
The following subsections describe three methods of starting and restarting the Grafana server: with systemd, initd, or by directly running the binary. You should follow only one set of instructions, depending on how your machine is configured.
### Start the Grafana server with systemd
Complete the following steps to start the Grafana server using systemd and verify that it is running:
1. To start the service, run the following commands:
```bash
sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl status grafana-server
```
1. To verify that the service is running, run the following command:
```
sudo systemctl status grafana-server
```
### Configure the Grafana server to start at boot using systemd
To configure the Grafana server to start at boot, run the following command:
```bash
sudo systemctl enable grafana-server.service
```
#### Serve Grafana on a port < 1024
{{< docs/shared "systemd/bind-net-capabilities.md" >}}
### Restart the Grafana server using systemd
To restart the Grafana server, run the following commands:
```bash
sudo systemctl restart grafana-server
```
> **Note:** SUSE or OpenSUSE users might need to start the server with the systemd method, then use the init.d method to configure Grafana to start at boot.
### Start the Grafana server using init.d
Complete the following steps to start the Grafana server using init.d and verify that it is running:
1. To start the Grafana server, run the following commands:
```bash
sudo service grafana-server start
sudo service grafana-server status
```
1. To verify that the service is running, run the following command:
```
sudo service grafana-server status
```
### Configure the Grafana server to start at boot using init.d
To configure the Grafana server to start at boot, run the following command:
```bash
sudo update-rc.d grafana-server defaults
```
#### Restart the Grafana server using init.d
To restart the Grafana server, run the following commands:
```bash
sudo service grafana-server restart
```
### Start the server using the binary
The `grafana-server` binary .tar.gz needs the working directory to be the root install directory where the binary and the `public` folder are located.
To start the Grafana server, run the following command:
```bash
./bin/grafana-server
```
## Docker
To restart the Grafana service, use the `docker restart` command.
`docker restart grafana`
Alternately, you can use the `docker compose restart` command to restart Grafana. For more information, refer to [docker compose documentation](https://docs.docker.com/compose/).
### Docker compose example
Configure your `docker-compose.yml` file. For example:
```bash
grafana:
image: grafana/grafana:latest
ports:
- "3000:3000"
environment:
- TERM=linux
- GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-piechart-panel,grafana-polystat-panel
```
Start the Grafana server:
`docker-compose up`
This starts the Grafana server along with the three plugins specified in the YAML file.
To restart the running container, use this command:
`docker-compose restart grafana`
## Windows
Complete the following steps to start the Grafana server on Windows:
1. Execute `grafana-server.exe`, which is located in the `bin` directory.
We recommend that you run `grafana-server.exe` from the command line.
If you want to run Grafana as a Windows service, you can download [NSSM](https://nssm.cc/).
1. To run Grafana, open your browser and go to the Grafana port (http://localhost:3000/ is default).
> **Note:** The default Grafana port is `3000`. This port might require extra permissions on Windows. If it does not appear in the default port, you can try changing to a different port.
1. If you need to change the port, complete the following steps:
a. In the `conf` directory, copy `sample.ini` to `custom.ini`.
> **Note:** You should edit `custom.ini`, never `defaults.ini`.
b. Edit `custom.ini` and uncomment the `http_port` configuration option (`;` is the comment character in ini files) and change it to something similar to `8080`, which should not require extra Windows privileges.
To restart the Grafana server, complete the following steps:
1. Open the **Services** app.
1. Right-click on the **Grafana** service.
1. In the context menu, click **Restart**.
## macOS
Restart methods differ depending on whether you installed Grafana using Homebrew or as standalone macOS binaries.
### Restart Grafana using Homebrew
Use the [Homebrew](http://brew.sh/) restart command:
```bash
brew services restart grafana
```
### Restart standalone macOS binaries
To restart Grafana:
1. Open a terminal and go to the directory where you copied the install setup files.
1. Run the command:
```bash
./bin/grafana-server
```
## Next steps
After the Grafana server is up and running, consider taking the next steps:
- Refer to [Get Started]({{< relref "../getting-started/" >}}) to learn how to build your first dashboard.
- Refer to [Configuration]({{< relref "./configure-grafana/" >}}) to learn about how you can customize your environment.

View File

@ -2,24 +2,26 @@
title: Serving Grafana on a port < 1024
---
If you are using `systemd` and want to start Grafana on a port that is less than 1024, then you must add a `systemd` unit override.
If you are using `systemd` and want to start Grafana on a port that is lower than 1024, you must add a `systemd` unit override.
1. The following command creates an override file in your configured editor:
1. Run the following command to create an override file in your configured editor.
```bash
# Alternatively, create a file in /etc/systemd/system/grafana-server.service.d/override.conf
systemctl edit grafana-server.service
```
```bash
# Alternatively, create a file in /etc/systemd/system/grafana-server.service.d/override.conf
systemctl edit grafana-server.service
```
1 Add these additional settings to grant the `CAP_NET_BIND_SERVICE` capability. To read more about capabilities, see [the manual page on capabilities.](https://man7.org/linux/man-pages/man7/capabilities.7.html)
1. Add the following additional settings to grant the `CAP_NET_BIND_SERVICE` capability.
```
[Service]
# Give the CAP_NET_BIND_SERVICE capability
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_BIND_SERVICE
To learn more about capabilities, refer to [capabilities(7) — Linux manual page](https://man7.org/linux/man-pages/man7/capabilities.7.html).
# A private user cannot have process capabilities on the host's user
# namespace and thus CAP_NET_BIND_SERVICE has no effect.
PrivateUsers=false
```
```
[Service]
# Give the CAP_NET_BIND_SERVICE capability
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_BIND_SERVICE
# A private user cannot have process capabilities on the host's user
# namespace and thus CAP_NET_BIND_SERVICE has no effect.
PrivateUsers=false
```