Raspberry Pi 2 Webmin Sever

Run Webmin  on a Raspberry Pi 2 Server

Raspberry Pi Webmin Server
Raspberry Pi Webmin Server

Webmin is a web-based interface for system administration on your Pi. Use any modern web browser and setup user accounts, Apache, DNS, file sharing and install other sever modules.

In otherwords,  once webmin is installed, via the web interface, you can install Apache and create a webserver or install samba / nfs/ Afp and create a network attached share that caters to multiple network protocols, shared folders with access permissionstime machine support, Create users, assign permissions, create a print server and a whole lot more.

 

Overview :

  • Download the latest Rasbian
  • Prepare a SD / Micro SD card to receive the downloaded Images.
  • Un compress and Transfer the downloaded Raspbian Image to the SD / Micro SD card.
  • Install Raspbian.
  • Configure Raspbian for a static network.
  • Add Webmin APT repository to the Sources list.
  • Install Webmin using the apt-get command.

Time and Difficulty :

  • Time : Between 15 and 20 mins  once you have the Raspbian Image file and the rest of the software.
  • Newbie Difficulty level : Moderately easy ; Will need to use terminal and type in commands.

What you will need :

  • Raspberry Pi 2 Model B or one of its clones like Banana Pi M1 or M2 or Banana Pro
  • Ethernet connection or a supported USB Wifi adapter for the Pi
  • SD or Micro SD Card that fits into your Pi (4GB or above is recommended)
  • USB Keyboard and Mouse
  • Connection to a TV or Monitor

You should seriously consider :

  • Learning about SSH and how to remotely access the Pi from another machine on your network.
  • Learning about Port forwarding settings for your Router.
STEP 1 : Install Raspbian
  1. The easiest way to install Raspbian is goto the Raspberry Pi downloads page and and download Noobs.
  2.  Follow the steps described in the Noobs setup Guide to get yourRasbian running. In the initial setup page, Select Raspbianand avoid the rest of the options for this project. The default loginand password are “pi‘ and “raspberry” respectively.
  3. Change the default password of the Pi during the first boot sequence in the Raspberry Pi configuration menu.  You can always go back to the Pi configuration menu by typing in ‘sudo raspi-config‘ at the command prompt.
  4.  Complete the Setup, restart the Pi with a ‘ sudo reboot‘ command.

 

STEP 2 : Give the Pi a static IP address

By default, the Pi is set to ask for a dynamic IP address from the router. You will need to change this setting to a fixed IP address since you will be using the Pi as some sort of a server and it’s more convenient that the address  be fixed. Even more so, if you are hosting a webpage- in which case, the port forward from your router always points to the Pi.

Assigning a Static IP address to the Pi can either be done at the Router level (which is fairly easy but the steps to do this are router’s model and brand specific) or at the Raspberry Pi level (outlined below).

Note :  replace the x in the lines below with what appears on your screen as you type in the commands.

Log on Raspbian and enter the following commands at the terminal :

  1. ifconfig” (ifconfig displays details of your current network connection )
  2. Write down the values next to inet add:192.168.x.xxx. These numbers is the IP address that your Pi is currently at.
  3. Also write down the Broadcast Range (Bcast) and Subnet Mask (Mask) that appear next to the inet add.
  4.  To get information from your router, type in “sudo route -n“.  This will give you the gateway and destination values.
  5. Write down the Gateway = 192.168.x.x & Destination = 192.168.x.x

We have now obtained all of the data that we need to setup our Raspberry Pi with a static IP address, it’s time to save it to a config file.

Type in “sudo nano /etc/network/interfaces”  ( nano is a text editor and will open the file interfaces located in the folder /etc/network)

In nano, look for the the line that reads “iface eth0 inet dhcp”. This line is telling the ethernet “eth0” networking interface to use “dhcp” (dynamic IP). Firstly, replace “dhcp or manual” with “static”.

Next , add the following lines directly below the line you just altered, with the data you had written down earlier.

address your.chosen.IP.address
netmask your.netmask
network  your.destination
broadcast your.broadcast.range
gateway your.gateway

The file should look something similar to the image below :

staticip

Save your file and exit out of nano by pressing ctrl+x

Reboot your Pi by typing in “sudo reboot

Once rebooted, your Pi will be on a static IP address. Crosscheck this by typing in “ifconfig” again.

STEP 3 : Configure and Install Webmin

Log in to your Pi via SSH and enter the following at the terminal :

sudo -i  (Enter the root level with elevated privileges )

nano /etc/apt/sources.list   (Use nano text editor to edit sources.list file located in the /etc/apt folder)

Edit Sources.list using nano
Edit Sources.list using nano

Paste the following lines once you are in nano :

 deb http://download.webmin.com/download/repository sarge contrib
deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib 

Press Ctrl+x to exit and Y to save the changes.

Next, step is to fetch and install the Webmin GPG key with which the repository is signed, with the commands :

Add the Webmin APT repository
Add the Webmin APT repository

cd /root (Navigate to the root folder)

wget http://www.webmin.com/jcameron-key.asc (download the key )

apt-key add jcameron-key.asc (add the key to apt-key)

The Pi is now read to Install Webmin.  Enter the following commands :

apt-get update
apt-get install webmin

Webmin will now download and install with all dependencies resolved.

Webmin will now download and install
Webmin will now download and install

The system will give an installation complete confirmation and access instructions.

You can now login via a web browser with the ip address of your Pi and port :10000
You can now login via a web browser with the ip address of your Pi and port :10000

The Raspberry Pi 2 Webmin Server can now be accessed by entering the ipaddress of your Pi and port 10000 (eg 192.168.0.105:10000)

ipaddress of your pi and port : 10000
ipaddress of your pi and port : 10000

Once you are logged in, you can update the pi, or install server modules,  create users, auto mount drives, monitor drives and whole lot more.

Use Webmin for all kinds of server administration tasks on your Pi
Use Webmin for all kinds of server administration tasks on your Pi

Caution : If you intend to remotely administer your Pi,  make sure all your passwords are changed from defaults, use the SSL protocol and make sure you following recommended security practices. Please read about SSH hardening, Server security and port forwarding. Also read the web server installation article.

 

15 thoughts on “Raspberry Pi 2 Webmin Sever”

  1. i dont get it , mine is stuck at unpacking webmin (1.780)

    “Get:6 http://mirrordirector.raspbian.org/raspbian/ jessie/main apt-show-versions all 0.22.4 [35.3 kB]
    Fetched 28.4 MB in 14s (1,947 kB/s)
    Selecting previously unselected package libnet-ssleay-perl.
    (Reading database … 129712 files and directories currently installed.)
    Preparing to unpack …/libnet-ssleay-perl_1.65-1+b1_armhf.deb …
    Unpacking libnet-ssleay-perl (1.65-1+b1) …
    Selecting previously unselected package libauthen-pam-perl.
    Preparing to unpack …/libauthen-pam-perl_0.16-3+b1_armhf.deb …
    Unpacking libauthen-pam-perl (0.16-3+b1) …
    Selecting previously unselected package libio-pty-perl.
    Preparing to unpack …/libio-pty-perl_1%3a1.08-1+b2_armhf.deb …
    Unpacking libio-pty-perl (1:1.08-1+b2) …
    Selecting previously unselected package libapt-pkg-perl.
    Preparing to unpack …/libapt-pkg-perl_0.1.29+b3_armhf.deb …
    Unpacking libapt-pkg-perl (0.1.29+b3) …
    Selecting previously unselected package apt-show-versions.
    Preparing to unpack …/apt-show-versions_0.22.4_all.deb …
    Unpacking apt-show-versions (0.22.4) …
    Selecting previously unselected package webmin.
    Preparing to unpack …/archives/webmin_1.780_all.deb …
    Unpacking webmin (1.780) …”

    dont know what i did wrong or what is going wrong im totaly new to the raspberry

    1. For anyone else who comes across this: version 1.831 of Webmin also suffers from the same issue, however you may just need to be patient – it took about 1 hour for mine to get past “Unpacking webmin”

  2. yeah indeed , i thought it was the install , but it was an corrupted sdcard, can someone please help me how to add an Qnap Nas over network, tried some differents ways but with no result.

    also tried it myself on Osx thru Terminal ssh

    //192.168.178.13/Multimedia /media/NAS/protected cifs username=xxxx,password=xxxxxx,uid=1000,gid=1000,iocharset=utf8 0 0

    sorry im still a beginner NOOB 😉

    1. Hi Alex. Should work on a rpi3 as well. The folks at Raspberry Foundation seem to go through great lengths to make sure the new hardware is fully compatible with older versions. Best of luck 🙂

Leave a Reply