vnstat.conf - Man Page

vnStat configuration file




vnstat(1), vnstati(1) and vnstatd(8) all use the same configuration file for configuration related settings. Some of the settings are common for all three programs. The file consists of keyword-argument pairs, one per line. Empty lines and lines starting with '#' are interpreted as comments and not processed. Arguments may optionally be enclosed in double quotes (") in order to represent arguments containing spaces. Arguments can be padded with spaces or tabulator characters. A hardcoded default value will be used if a keyword can't be found from the configuration file or if the configured value cannot be parsed or is outside supported value range.

The configuration file is divided into three sections based on the usage of each keyword. The first section contains keywords that are considered common for all commands, the second section is for daemon related keywords and the last section is for image output.

Common Keywords


Specifies the directory where the database is to be stored. A full path must be given and a leading '/' isn't required.

DayFormat, MonthFormat, TopFormat

Formatting of date in available outputs. Uses the same format as date(1). (vnstat and vnstati only)


Number of decimals to use in outputs. Value range: 0..2 (vnstat and vnstati only)


Show a visual representation of the traffic estimation if OutputStyle has been configured with a value of 1 or 2 to make the bar column visible. 1 = enabled, 0 = disabled. (vnstat only, see EstimateStyle for vnstati)


Number of decimals to use in hourly graph output. Value range: 0..2 (vnstat only)


Select what kind of spacer is used for separating the numerical sections of the hourly graph output. 0 = none, 1 = '|', 2 = '][', 3 = '[ ]'. (vnstat only)


Default interface used when no other interface is specified on the command line. Leave empty for automatic selection. The automatic selection will prioritize the interface with most traffic for outputs doing database queries. Queries not using the database will first check if the database is available and select the interface with most traffic out those that are currently visible in the system. If no database can be read then the first available interface will be used. (vnstat and vnstati only)

List5Mins, ListHours, ListDays, ListMonths, ListYears, ListTop

Number of entries to show in list outputs unless overridden from the command line. Set to 0 to show all entries available in the database. (vnstat and vnstati)


Locale setting to be used for prints. This replaces the LC_ALL environment variable. Set to "-" or leave empty in order to use the system default value. (vnstat and vnstati only)


Modify the content and style of text outputs. 0 = minimal and narrow output for terminal with limited width, 1 = normal output with bar column visible, 2 = same as 1 except rate is visible in summary output, 3 = rate column is visible in all outputs where it is supported. (vnstat and vnstati only)


Default query mode when no parameters are given. 0 = normal, 1 = days, 2 = months, 3 = top, 5 = short, 6 = years, 7 = hours graph, 8 = xml, 9 = one line, 10 = json, 11 = hours and 12 = 5 minute. (vnstat only)


Select which unit is used when traffic rate is visible. 0 = bytes, 1 = bits. (vnstat and vnstati only)


Select used prefix when traffic rate is shown in bits per second. IEC binary prefixes are calculated with powers of 1024. SI decimal prefixes are calculated with powers of 1000. 0 = IEC binary prefixes (Kibit/s...), 1 = SI decimal prefixes (kbit/s...). (vnstat and vnstati only)

RXCharacter, TXCharacter

Character used for representing the percentual share of received and transmitted traffic in list mode outputs. (vnstat only)

RXHourCharacter, TXHourCharacter

Character used for representing the percentual share of received and transmitted traffic in hourly graph output. (vnstat only)


Defines how many seconds the -tr option will sample traffic. Value range: 2..600 (vnstat only)


Select how units are prefixed. IEC and JEDEC binary prefixes are calculated with powers of 1024. SI decimal prefixes are calculated with powers of 1000. 0 = IEC standard prefixes (B/KiB/MiB/GiB...), 1 = old style (JEDEC) binary prefixes (B/KB/MB/GB...), 2 = SI decimals prefixes (B/kB/MB/GB...) (vnstat and vnstati only)



Config file that will be used unless $HOME/.vnstatrc exists or alternative value is given as command line parameter.


Using long date output formats may cause misalignment in shown columns if the length of the date exceeds the fixed size allocation.


Teemu Toivola <tst at iki dot fi>

See Also

vnstat(1), vnstati(1), vnstatd(8), units(7)

Referenced By

vnstat(1), vnstatd(8), vnstati(1).

MAY 2021 version 2.7 User Manuals