Quickstart ¶
This page explains how to download and install ConfigServer Security & Firewall in very minimal detail. This guide is good for:
- Users migrating from CSF v14.x or older, to this repository.
- Users who need a clean install
- Users who have not enabled the web interface.
If you need detailed instructions, please view the full installation guide.
Summary¶
The following is a summary of what this page explains:
- How to download CSF
- How to install CSF
- Basic Configuration
- Enabling the Web Interface
- Whitelisting your user IP
- Accessing the CSF Web interface
- Troubleshooting help
Setup¶
The instructions below are a very minimized version of our full installation guide. If you want a very quick setup and installation for CSF; follow the instructions below.
Download¶
Download the latest version of CSF with one of the following commands:
Extract the contents from the .zip or .tgz archive to your machine:
Install¶
Once CSF is extracted, run the installation script:
Basic Configuration¶
Next, we need to edit a few settings in the CSF configuration file. These are the bare minimum to get the CSF and LFD services running, however, you can edit any other settings along the way that you deem appropriate to change. Open the file /etc/csf/csf.conf in a text editor; and edit the following:
Required: You must set TESTING mode to 0 or LFD will not start:
Optional: If you have a CSF license key from our Sponsor Program, enter it here.
Required: Enable the CSF web interface:
Optional: To change the default web interface port, modify the following:
Optional: This setting tells CSF which network adapter / IP to bind to. If you leave this blank,
it will bind to all, which is the equivilent of using 0.0.0.0.
If you wish to place CSF behind a reverse proxy such as Traefuk, and are using Docker for your setup, you can bind to the Docker bridge. Pick ONE of the suggested values below:
Optional: This setting is not required, but is worth mentioning. Out-of-box, CSF does not allow external access to your install of CSF for good reason.
If you are unable to access the CSF web interface, you can temporarily disable this to debug ONLY by setting this value to 0. Do not leave the value set to 0.
Required: Set an admin username and password. If you keep the default values, LFD will not start.
Whitelist User IPs¶
Next, we need to whitelist the IP address you will be using to access the CSF web interface. This can be both WAN and LAN IPs, depending on your network structure. If you do not whitelist your IP, you will be unable to access the CSF Web Interface.
Open /etc/csf/ui/ui.allow, and add one IP address per line:
Restart CSF & LFD¶
Once everything configured, restart the CSF and LFD services:
Confirm there are no errors by viewing the file /var/log/lfd.log. If you see any errors similar to the following, this means you have not whitelisted the correct
IP address within /etc/csf/ui/csf.allow:
Access Web Interface¶
To access the CSF web interface, open your browser and navigate to the local IP address associated with the machine that CSF
is installed to. In our guide above, we changed the default port to 8765, so we will navigate there:
If you are unable to view the CSF web interface, visit our Troubleshooting section below.
Enter the username and password you defined in your /etc/csf/csf.conf as:
Troubleshooting¶
The following is a list of questions a user may have regarding updates to CSF, and information about certain issues that may arise:
LFD: Cannot Start Service
Confirm if LFD service is running:
If the service says Stopped or Failed, run the following tail command to look at the LFD logs located in /var/log/lfd.log:
If you see the output above, you must disable TESTING. Open the file /etc/csf/csf.config:
Also ensure that you have changed the default username and password in your /etc/csf/csf.conf. You cannot use the
default values.
Finally, make sure you have whitelisted the IP address you will use to access the CSF web interface. Open /etc/csf/ui/csf.allow and add your
IP to the file, one IP-per-line:
Restart CSF and LFD services:
Confirm the status of LFD again:
If none of the above helps you solve it, you can also try to run LFD with strace:
rt_sigaction(SIGRT_25, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGRT_26, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGRT_27, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGRT_28, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGRT_29, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGRT_30, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGRT_31, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGRT_32, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGABRT, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGCHLD, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGIO, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
exit_group(0) = ?
+++ exited with 0 +++
Using strace will give you hints of any issues or errors. In the example above, lfd exits with error code 0,
which means “success / no error”. The program is choosing to shut itself down and telling the OS “I finished cleanly”.
This tells us that it's not due to something failing. When a daemon exits cleanly (exit code 0), you usually have to look inside lfd's own logs, not just systemd’s.
In the examples above, we see in /var/log/lfd.log that it was due to us having TESTING enabled.
Another option for checking failure reasons is to run:
You can also check journalctl for any errors:
All of the listed methods above will help you narrow down exactly why LFD or CSF are not starting properly.
Web Interface: Browser says access restricted using default port 6666
Out-of-box, Firefox and Chromium-based browsers block access to port 6666. To access the CSF web
interface, you must do ONE of the following:
- Cconfigure your browser to allow access to port
6666; OR - Change the default port assigned to the CSF web interface within
/etc/csf/csf.conf
To allow port 6666 in your browser, follow the instructions on the page
Troubleshooting › Address Restricted
To change the port used for the CSF web interface, follow the instructions on the page Install › Web Interface › Setup.
Next Steps ¶
Select what documentation you would like to proceed with next ...
-
If the quickstart guide doesn’t work for your setup, the full installation guide provides clear, step-by-step instructions to install CSF properly.
The guide is split into multiple pages, with each page covering a single stage of the setup process in detail.
The full instructions will start on the Install: Dependencies page.
-
The web interface lets you manage your firewall through a browser instead of a command line.
This chapter covers installation of dependencies, enabling the interface, and whitelisting your IP for security.