1 Installation instructions
2 =========================
4 This chapter describe the various methods for installing Network UPS Tools.
6 Whenever it is possible, prefer <<Installing_packages, installing from packages>>.
7 Packagers have done an excellent and hard work at improving NUT integration into
11 Installing from source
12 ----------------------
14 These are the essential steps for compiling and installing this software.
16 The NUT linkdoc:packager-guide[Packager Guide], which presents the best
17 practices for installing and integrating NUT, is also a good reading.
21 ================================================================================
23 - the paths shown below are the default values you get by just calling
24 configure by itself. If you have used --prefix or similar, things will be
25 different. Also, if you didn't install this program from source yourself, the
26 paths will probably have a number of differences.
28 - by default, your system probably won't find the man pages, since they
29 install to /usr/local/ups/man. You can fix this by editing your MANPATH, or
32 man -M /usr/local/ups/man <man page>
34 - if your favorite system offers up to date binary packages, you should always
35 prefer these over a source installation. Along with the known advantages of such
36 systems for installation, upgrade and removal, there are many integration issues
37 that have been addressed.
39 ================================================================================
48 Create at least one system user and a group for running this software. You
49 might call them "ups" and "nut". The exact names aren't important as
50 long as you are consistent.
52 The process for doing this varies from one system to the next, and
53 explaining how to add users is beyond the scope of this document.
55 For the purposes of this document, the user name and group name
56 will be 'ups' and 'nut' respectively.
58 Be sure the new user is a member of the new group! If you forget to
59 do this, you will have problems later on when you try to start upsd.
69 Configure the source tree for your system. Add the '--with-user' and
70 '--with-group' switch to set the user name and group that you created
73 ./configure --with-user=ups --with-group=nut
75 If you need any other switches for configure, add them here. For example:
77 * to build and install USB drivers, add '--with-usb' (note that you
78 need to install libusb development package or files).
80 * to build and install SNMP drivers, add '--with-snmp' (note that
81 you need to install libsnmp development package or files).
83 * to build and install CGI scripts, add '--with-cgi'.
85 See <<Configure_options,Configure options>> from the User Manual,
86 docs/configure.txt or './configure --help' for all the available
89 If you alter paths with additional switches, be sure to use those
90 new paths while reading the rest of the steps.
92 Reference: <<Configure_options,Configure options>> from the
101 This will build the NUT client and server programs and the
102 selected drivers. It will also build any other features that were
103 selected during <<Configuration,configuration>> step above.
110 =====================================================================
112 you should now gain privileges for installing software if necessary:
116 =====================================================================
118 Install the files to a system level directory:
122 This will install the compiled programs and man pages, as well as
123 some data files required by NUT. Any optional features selected
124 during configuration will also be installed.
126 This will also install sample versions of the NUT configuration
127 files. Sample files are installed with names like ups.conf.sample
128 so they will not overwrite any existing real config files you may
131 If you are packaging this software, then you will probably want to
132 use the DESTDIR variable to redirect the build into another place,
135 make DESTDIR=/tmp/package install
136 make DESTDIR=/tmp/package install-conf
142 Create the state path directory for the driver(s) and server to use
143 for storing UPS status data and other auxiliary files, and make it
144 owned by the user you created.
146 mkdir -p /var/state/ups
147 chmod 0770 /var/state/ups
148 chown root:nut /var/state/ups
151 Ownership and permissions
152 ^^^^^^^^^^^^^^^^^^^^^^^^^
154 Set ownership data and permissions on your serial or USB ports
155 that go to your UPS hardware. Be sure to limit access to just
156 the user you created earlier.
158 These examples assume the second serial port (ttyS1) on a typical
159 Slackware system. On FreeBSD, that would be cuaa1. Serial ports
160 vary greatly, so yours may be called something else.
162 chmod 0660 /dev/ttyS1
163 chown root:nut /dev/ttyS1
165 ////////////////////////////////////////////////////////////////////////////////
167 ////////////////////////////////////////////////////////////////////////////////
169 The setup for USB ports is slightly more complicated. Device files
170 for USB devices, such as /proc/bus/usb/002/001, are usually
171 created "on the fly" when a device is plugged in, and disappear
172 when the device is disconnected. Moreover, the names of these
173 device files can change randomly. To set up the correct
174 permissions for the USB device, you may need to set up (operating
175 system dependent) hotplugging scripts. Sample scripts and
176 information are provided in the scripts/hotplug and
177 scripts/udev directories. For most users, the hotplugging scripts
178 will be installed automatically by "make install".
180 (If you want to try if a driver works without setting up
181 hotplugging, you can add the "-u root" option to upsd, upsmon, and
182 drivers; this should allow you to follow the below
183 instructions. However, don't forget to set up the correct
186 NOTE: if you are using something like devfs or udev, make sure
187 these permissions stay set across a reboot. If they revert to the
188 old values, your drivers may fail to start.
191 You are now ready to configure NUT, and start testing and using it.
193 You can jump directly to the <<Configuration_notes,NUT configuration>>.
196 [[Installing_packages]]
197 Installing from packages
198 ------------------------
200 This chapter describes the specific installation steps when using
201 binary packages that exist on various major systems.
204 Debian, Ubuntu and other derivatives
205 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
207 NOTE: NUT is packaged and well maintained in these systems.
208 The official Debian packager is part of the NUT Team.
210 Using your prefered method (apt-get, aptitude, Synaptic, ...), install
211 the 'nut' package, and optionaly the following:
213 - 'nut-cgi', if you need the CGI (HTML) option,
214 - 'nut-snmp', if you need the snmp-ups driver,
215 - 'nut-xml', for the netxml-ups driver,
216 - 'nut-powerman-pdu', to control the PowerMan daemon (PDU management)
217 - 'nut-dev', if you need the development files.
219 ////////////////////////////////////////////////////////////////////////////////
222 ////////////////////////////////////////////////////////////////////////////////
224 Configuration files are located in /etc/nut.
225 linkman:nut.conf[5] must be edited to be able to invoke /etc/init.d/nut
227 NOTE: Ubuntu users can access the APT URL installation by clicking on link:apt://nut[this link].
234 NOTE: NUT is packaged and well maintained in these systems.
235 The official Mandriva packager is part of the NUT Team.
237 Using your prefered method (urpmi, RPMdrake, ...), install one of the two below
240 - 'nut-server' if you have a 'standalone' or 'netserver' installation,
241 - 'nut' if you have a 'netclient' installation.
243 Optionaly, you can also install the following:
245 - 'nut-cgi', if you need the CGI (HTML) option,
246 - 'nut-devel', if you need the development files.
253 NOTE: NUT is packaged and well maintained in these systems.
254 The official Suse packager is part of the NUT Team.
256 Install the 'nut-classic' package, and optionaly the following:
258 - 'nut-drivers-net', if you need the snmp-ups or the netxml-ups drivers,
259 - 'nut-cgi', if you need the CGI (HTML) option,
260 - 'nut-devel', if you need the development files,
262 NOTE: Suse and Opensuse users can use the
263 link:http://software.opensuse.org/search?baseproject=ALL&p=1&q=nut[one-click install method]
268 Red Hat, Fedora and CentOS
269 ~~~~~~~~~~~~~~~~~~~~~~~~~~
271 NOTE: NUT is packaged and well maintained in these systems.
272 The official Red Hat packager is part of the NUT Team.
274 Using your prefered method (yum, Add/Remove Software, ...), install one of the
277 - 'nut' if you have a 'standalone' or 'netserver' installation,
278 - 'nut-client' if you have a 'netclient' installation.
280 Optionaly, you can also install the following:
282 - 'nut-cgi', if you need the CGI (HTML) option,
283 - 'nut-xml', if you need the netxml-ups driver,
284 - 'nut-devel', if you need the development files.
291 You can either install NUT as a binary package or as a port.
296 To install the main component, use the following command:
303 The port is located under /usr/ports/sysutils/nut.
304 To install it, use the following command:
306 # cd /usr/ports/sysutils/nut/ && make install clean
308 You have to define WITH_NUT_CGI to build the optional CGI scripts.
310 Optionaly, you can also install the following ports:
312 - sysutils/nut-snmp, for the SNMP driver,
313 - sysutils/nut-usb, for the USB drivers,
314 - sysutils/nut-libupsclient, for the upsclient library.
317 You are now ready to configure NUT, and start testing and using it.
319 You can jump directly to the
320 <<Configuration_notes,NUT configuration>>.