Here is a guide on how to setup/configure your very own OpenVPN, Media Streamer, File Server, T0rrent Downloader and a Software Router, all in one Linux server box.
Here is another Linux tutorial on how you would setup/configure your own multiple-in-one Linux home server. This guide will walk you through on how to configure a file server, OpenVPN server, media & streaming server, and a 24/7 t0rrent downloader, all under one Linux server box. This would be a power consumption saver for you, so if you’re interested in following this guide, then read further below.
What Is ClearOS
It is a Linux Distro based on CentOS that you could use as a Network Gateway and Network Server, which is designed for home, home office, small and medium enterprises.
It is a headless server and installable on bare-metals, which has a Web UI.
To find more about ClearOS, visit it’s Wiki page. All important links are listed in there.
Jump Links
- ClearOS Installation
- ClearOS Configuration
- OpenVPN Server Setup
- Plex Media Server Setup
- File Server Setup
- T0rrent Server Setup
Phase 1: ClearOS Installation
For this multiple in one server setup guide, we’ll be using another opensource and free Linux-based distribution called ClearOS Community Edition. It is based on CentOS 6.
The community edition is designed for home users, hobbyists, enthusiast and Linux developers. ClearOS has a Marketplace for Applications and Addons, just like Android Market or Google Play. Using the Marketplace, you could install and uninstall additional applications for your server in just a breeze.
To get started with the installation and setup, read further below.
Basic Installation and Setup Requirements
- ClearOS Installation CD, download the ISO format and burn it to CD/DVD
- A spare PC for the server or build another one for this purpose
- 1 Hard Drive, this will serve as your boot drive and data drive
- CD/DVR ROM drive or USB stick to hold the ClearOS installer
- A working home LAN
- 2 Ethernet Port, 1 for LAN and 1 for Internet access
- 2 Ethernet Cables
Installation Steps
Step 1: Insert the ClearOS install cd to your CD/DVD ROM drive and set your BIOS to boot from it. Then you should now be ready to boot your server.
Step 2: If you successfully booted up from the install CD, you should see a screen similar to the image shown below.
Select
Install or upgrade an existing system
and press enter to start the installation wizard.Step 3: A ClearOS splash screen should be shown now, click next and choose your language setting, click next again and choose your keyboard language settings and click next again.
Note: Storage Device Warning will pop-up and will prompt you to discard any existing data. This will show if your hard drive is blank or un-partitioned. To automatically partition it, click
Yes, discard any data
.Step 4: Choose your mode for your storage devices, you may select
Basic Storage Device
orSpecialized Storage Devices
. But for the purpose of this guide, select the Basic Storage Devices mode.Note: Specialized Storage Devices is used for more complex setup for your storage devices like SAN or iSCSI.
For now, we should be good using the Basic mode, so choose “Basic Storage Device” and click next.
Step 5: Enter the hostname for the server, including the domain part. In my case, I entered
myserver.chubbable.lan
. Once you entered your desired hostname, click next to continue with the next step.Step 6: Choose your timezone, you may click on the map or select from the drop-down menu. Click next after choosing one.
Step 7: Enter your desired admin/root password and click next.
Step 8: Choose installation type, since this is a new installation on a blank hard drive, choose
Use All Space
and click next two times and finally click format, then finally clickWrite changes to disk
.Click next again when already in the bootloader install screen. Make sure “Install boot loader” is checked then click the “Next” button to start the installation process. It will take several minutes to complete the process.
Step 9: Reboot, after a successful install. Click the “Reboot” button to do a reboot. After you reboot, a login screen should prompt you. That’s it for the installation part, next part will be the configuration of ClearOS from the admin dashboard.
ClearOS Configuration Guide
Before you can use your ClearOS server within your network, you need first to configure it and install the necessary add-ons/apps to setup a multiple-in-one Linux home server.
After you reboot your machine after installation, you should see a screen similar to the image shown below.
Reference Image Here:
Step 1: Choose Network Mode. For this guide we’re going to use
Gateway
mode, so ClearOS will be hosting your internet connection as well as the firewall between your internal network and the Internet.Under “Settings” click on
Edit
button, then a new screen should open. SelectGateway Mode
from the drop-down menu for “Network Mode”. Then click onUpdate
button.Step 2: Configure the network settings. Click on the
Configure network now
button and you should be presented with a login screen. Login using the user-nameroot
and the password you entered during the ClearOS server installation.Then you should see a screen with a
Network Interface
titled block. You should see your two ethernet ports here. In my case,eth0
is my on-board Ethernet Card andeth1
is my add-on ethernet card. For this guide, I’m going to use the add-on Ethernet card (10/100 Mbps) as my Internet connection, the port that will connect to the modem (which is in bridged-mode), whileeth0
shall be my LAN port.To continue, click on
Edit
button that corresponds to theeth0
port. A new screen should appear, underSettings
click the drop-down menu forRole
, then selectLAN
.Next, click the drop-down menu for
Connection Type
then chooseStatic
.Now fill-up the “IP Address” and “Netmask” matching your currently working network configuration, then click on
Update
button. The IP address that you set here will be the address of the Admin Web-UI, so take note of it.You should be back on the “Network Interfaces” screen, now edit “eth1” and setup your Internet connection type. Click the
Add
button to edit the role for this ethernet port. Under “Role” drop-down menu, selectExternal
, then under “Connection Type” drop-down menu, selectPPoE
if you’re on DSL connection whileDHCP
if you’re on a Cable Internet connection. Fill-up user-name and password if you set it toPPoE
. Your DSL modem should be in bridged-mode to make “PPoE” connection work.Finally, click the
Add
button to finish the setup for this part.You can now continue editing the configuration from the ClearOS Admin Web-UI by accessing
https://clearosip-you-set:81
using a browser from another machine.Note: You should use
https
and take note of the port number, it should be81
.Step 3: Continue with the ClearOS configuration. Using a browser from another machine, access the ClearOS server’s IP address by typing
https://clearos-ip:81
in the address bar.You should see a login screen. Now login as
root
then enter your user-password.You should now be at the Admin Dashboard.
Step 4: Continue and finish the configuration wizard. Using the Admin Web-UI, continue with the wizard and click on
Next
button found on the left-side of the screen. Click on it repeatedly until you reach the “Software Update” screen.You should see some available updates from this screen. If you’re not seeing anything, then you probably didn’t setup your network properly. Troubleshoot it first then go back to this point to continue with the setup.
If you see available updates, install them by clicking
Next
button again. Then clickNext
again when you see “Installation complete” dialogue.Step 5: System registration. After the above step, click “Next” again to go to the “System registration” screen of ClearOS configuration wizard.
To complete the registration process of your system, you must have already a ClearOS account. If you don’t have it yet, then create a new one by clicking on the
Create Account
button. Then fill-up the required fields and click theCreate Account
button again. When done creating your account, go back to “System Registration” screen and input your registered account details.You need to enter details for “Account”, “Password”, “Type”, “System Name”, and “Environment”.
For the “Account” and “Password”, enter your registered account name and password. For “Type”, select
New Install
orUpgrade/ Re-install
if you’re doing a re-install. For “Environment”, you may selectHome
orHome Office
since you’ll be using this server only as a Linux home server.Click “Register System” after filling those required fields.
Once your system has been registered, you’ll gain access to ClearOS marketplace and you’ll be able to select several add-ons/application that you’d wanted to install in your ClearOS Linux home server.
Click “Next” to go to the next step.
Step 6: Internet domain setup. Just enter your desired domain here, simply enter the domain name that you’ve entered during the ClearOS install process. In my case, I’ve entered
chubbable.lan
.Click “Next” to continue with the next step.
Step 7: Hostname setting. You need to name your system by giving it a proper hostname. On this page, you need to configure both “Hostname” and “Internet Hostname”. You could enter the same name in “Hostname” and “Internet Hostname”.
So you could enter it like so: Hostname – clearos.chubbable.lan Internet Hostname – clearos.chubbable.lan
Note: If you have services hosted on this server and you want to access it from outside of your local network, like OpenVPN service, you need to set “Internet Hostname” and give it a proper hostname with domain name or a fully qualified domain name (FQDN). For instance,
clearos.chubbable.com
instead ofclearos.chubbable.lan
. You can use a Dynamic DNS service for this, so you can get your own FQDN and you’ll be able to access your server from the internet using your server’s FQDN. DDNS service shall be first configured before you could make that hapen. More about this on my next blog post.Click “Next” to continue.
Step 8: Setup your server’s timezone. Simply select your timezone from the drop-down menu, click “Synchronize Now” and then click “Next” button to continue.
Step 9: Marketplace Apps Installation. This is the part where you could install whatever apps you might need to use with your server. The is the step where we install the File Server app, the OpenVPN server app, Plex app and other apps that are available in ClearOS Marketplace.
While on the “Welcome to Marketplace” screen, click “Install apps by category” button and click “Next”. Now, depending on your Internet speed, it will take some moments to retrieve the list of available Marketplace Apps.
You could install a lot of apps from this page of the configuration wizard, but for this guide we’ll just choose some of the apps:
- Under the “Cloud” tab, choose
Dynamic DNS
- Now click on “Gateway” tab and choose
Intrusion Detection
andIntrusion Prevention
. - Switch to “Server” tab and choose
Flexshare
,Plex Media Server
, andTransmission BT Client
. - Switch to “Network” tab and choose
OpenVPN
, andPort Forwarding
.
Then click “Next” to go to the “App Review” screen and then finally click “Download and Install” button (left of Delete All button) to start the app download and installation. This will download and install all your selected apps.
You will know that download and installation is finished once the overall progress bar is filled up. Click “Finish and Installation Wizard” button to finish the wizard.
You should be now at the ClearOS Admin Dashboard and congratulation! You have now setup and configured ClearOS on your sytem.
Next task would be to configure each app that we’ve installed to work within our local network.
- Under the “Cloud” tab, choose
OpenVPN Setup
OpenVPN is a free and opensource software that you could use to implement a Virtual Private Network. It uses SSL/TLS for it’s security protocol. You can use this to create a site-to-site or point-to-point secure connecttion.
You could also use and implement OpenVPN as a stand-alone access server by installing it on a Linux distribution like Ubuntu or CentOS. It is also available as a software package in pfSense. Pfsense stylized as “pfSense” is another opensource application which is a FreeBSD-based software firewall. Checkout this guide if you want to use pfSense with OpenVPN.
Procedures
Step 1: Allow Incoming Connection For OpenVPN Clients – You need to setup the firewall to accept incoming connection to your OpenVPN server, to do this navigate to
Network > Firewall > Incoming Firewall
. Click the “Add” button and selectOpenVPN
from the drop-down menu labeled “Service”, then click “Add” button.Reference Image:
Step 2: Create Internal Certificate Authority – This shall be used in all and future user certificate and other internal certificate like the certificate for your OpenVPN server.
To start off with this procedure, navigate to
System > Security > Certificate Manager
tab from the admin dashboard. Then fill-up the required fields.In my case, I did it like so: Internet Hostname – clearos.chubbable.lan Organization – Chubbable Unit – Tech City – New York State – New York Country – United States
Then click the button “Create Certificate”. Upon clicking on the button, you should be taken to another screen with a warning that mentions about “The web interface is restarting with the new security certificates.”. Just click the “Continue” button to proceed. You’ll see a warning page after clicking the button, go ahead and continue, the warning just warns you about the SSL certificate. It’s safe to proceed, the warning just pops up since the certificate you’ve just created is a self-signed one. That means, it’s not signed by Certificate Authorities or providers like Symantec or Comodo.
Two certificates in
.pem
format shall appear under “Certificates Manager”, one for Certificate Authority and one for your server.Reference Image:
Step 3: Enable User Management – You must enable this feature first before you can create a new user account for OpenVPN. Go to
System > User
menu, and clickInitialize Built-in Directory
. Wait for it to initialize until you see the “Add” button.Click the “Add” button to create a new user account for OpenVPN, a new screen should be shown, now fill-up the necessary fields and then click the “Add” button below those fields.
This is how I filled-up mine: Username – userone First Name – Rolling Last Name – Pin Password – ****** OpenVPN User – Enabled Security Certificates User – Enabled
Step 4: Create A User Certificate and Download the Configuration File – After creating your user account, log off from the admin dashboard ang login as the user you just created. So in my case, I would login as “userone” instead of “Admin”.
On the left side of your dashboard, click on “User Certificates” under “Accounts” and fill-up the Password field. This password will be use to protect the certificate, it’s a different password from your user-account password. So enter your password and click
Create Certificate
button.After clicking the button, download the OpenVPN configuration file for your platform, choose from the drop-down menu for OpenVPN “Configuration File” and click the download button. You may choose from Linux, Windows and Mac.
Also, don’t forget to download the certificate files; Certificate (useraccountname-cert.pem), Certificate Authority (ca-cert.pem), PKCS12, Private Key (useraccountname-key.pem).
Put the files in the same folder where .ovpn file is where at.
Step 5: How To Connect To The OpenVPN Server?
Connecting to the OpenVPN server is fairly easy. You can connect from Linux, Mac, Windows or Android.
Note: You can actually edit your .ovpn file and use your server’s IP address instead of a HOSTNAME. Open .ovpn file using a text editor and look for the line starting with
remote
. Changeremote your-server-hostname 1191
toremote your-server-ipaddress 1194
.Windows – First download the client software from this page. Download the appropriate version for your Windows. Then install the software by double-clicking on the
.exe
file. After you install it, open the GUI by double-clicking on “OpenVPN GUI” desktop shortcut. The GUI icon should now appear in your system tray. If you right-click on it, you’ll notice that there is no “Connect” menu yet, that’s because you haven’t added your VPN config file yet.To add your OpenVPN config files and certificate, go to the OpenVPN installation folder and look for
config
folder. Put your.ovpn
config and certificate files there. Now, right click on your OpenVPN system tray icon, you should now see a “Connect” menu. Click “Connect” and enter your OpenVPN user-name and user-password, then click OK to make the connection.Linux – Download the
.ovpn
file for Linux and also don’t forget to download the certificate files. Place the files in the same folder and store it in a permanent location.Install
network-manager-openvpn-gnome
andopenvpn
from command-line, if it’s not installed yet.sudo apt-get install network-manager-openvpn-gnome openvpn
If you’re on Linux Mint – Go to Menu > Preferences > Network Connections > Add. Then click on the drop-down menu and scroll further down until you see
Import a saved VPN configuration
, click on it and then click the “Create” button. Now browse to where your.ovpn
config file is. Then enter your user-name, user-password and Private key password. User Certificate, CA Certificate, Private key should be auto populated. Click “Save” button. You can now click on the networking icon from your system tray and your VPN account should be available. Click on it to make the connection.
Plex Media Server Setup
Plex software is a great software to organizer your media files. You can put them in libraries, categories and stream them to various UPnP and DLNA clients like Android devices, Windows, MaC, Linux, SmartTV and few more others.
Procedure
Step 1: To configure Plex for the first time, login as “root” to your ClearOS admin dashboard.
Step 2: Navigate to “Server” tab and click on
Plex Media Server
, thenGo To MyPlex
. Plex dashboard should now open and you’ll be greeted by “Plex Terms of Service” window, click “Agree” button to continue accessing the dashboard.
Now you might ask “how to add files to my plex media server?”, well there are various ways on how to add your media files. It depends on your situation or media source. Your media source could be in a single drive, in a raided drives inside a server, or maybe a NAS.
If you stored your media files in a single big drive or raid box with SATA connection, you could simply attach it to your ClearOS server, then create a directory for the files and use rsync
or similar tools to copy or sync your media files. After you transfer your files to your ClearOS server, login to your Plex admin gui and create a new media library and set the path to your media directory you’ve created. To learn more about this, read my post about adding files to a Linux media server.
If you stored your files in another file or media server, but you are not able to detach your drives because it’s raided (either software or hardware raided), you can use flexshare and Windows networking for that to copy files from your existing media/file server to your new ClearOS server. You need to have a running home network for this. You need to create a mount point inside your ClearOS server and mount the shard folder from your existing file server. More instruction on this later in another post.
File Server Setup
Setting this feature in ClearOS will let you share folders and files to client machines like Windows, Mac or Linux. For this to work, you must first install “Windows Networking” from the ClearOS Marketplace, then create a group and users for the folder share.
Procedure
Step 1: Install “Windows Networking” module. Login as “root” to ClearOS admin dashboard and click on the marketplace icon. It’s the cloud icon with down-arrow that sits on the top-right corner of your dashboard. Use the search function on the left-side of the screen and search for “Windows Networking”. Then look for the “Windows Networking” button and click on it, then click “Install/Upgrade Selected Apps”. That should install the module.
Step 2: Initialize built-in directory by clicking on Server > Windows Networking > Initialize Built-in directory
. Once initialized, go to the next step below and configure “Windows Networking”.
Step 3: Configure Windows Networking by entering your desired Sever Name
and Windows Domain
. Also enter your admin password, winadmin
shall be the default user-name for the administrator. Then click Initialize
to start the service. You should be taken to another configuration screen.
Step 4: Edit Windows Networking Mode. You can choose between two modes, Primary Domain Controller and Simple Server. In simple server, you can use the login user-name and user-password of a Windows user as the user-credentials for a shared directory. This is the mode that we would want to use. This mode makes use of “Workgroup” name instead of a “Domain” name.
Click on the “Edit” button under the “Mode” block and click on the drop-down menu labeld “Mode”, then choose “Simple Server’. Click “Update” button to save the changes.
Step 5: Create Group. Navigate to System
> Accounts
> Groups
and click the “Add” button to create a new group for your file server service. In my case, I named my group fileshare
.
Step 6: Create User. Create a new user-account and assign it to the group fileshare
or the whatever group name you came up with. Navigate to System
> Accounts
> Users
and click the “Add” button to create a new user-account. The user-account could be an existing user-account on your Windows-based machine, let’s say UserXP
. But you don’t need need to follow the character case of the name, you could enter it in all lower-case, like userxp
. You could also add additional user-account that does not exist yet on any of your Windows machine. You could create a user-account for your Linux-based machine which is not actually a user on your Linux machine.
Fill-up the all the necessary fields and don’t forget to enable OpenVPN User
and Security Certificates User
, as well as ticking the group name for the user-account. Click “Add” button to save the your changes.
Step 7: Create the folder to share via FlexShare menu. Navigate to Server
> FlexShare
> Click ADD button
. For the purpose of illustration, I’d name my folder Shared
. So I’d type that in under Share Name
field. Enter description for the folder and assign it to group fileshare
or the name you came up with. Set “Third Party App Access” to disabled for now. Finally click the “Add” button.
Your dashboard will reload and you should see the “Windows File Share” block. You can see that the “Status” is set to “Disabled”. To enable the folder share, click the “Edit” button and set “Status” to Enabled
. You decide whether you allow read and write permission for the shared folder. Click “Update” to save your changes.
Step 8: Accessing your shared folder. Test your configuration and see if you can access your ClearOS shared folder.
For this guide, I’ve configured the FlexShare/Windows Networking configs like so:
Server Name - MyServer
Workgroup - MyLAN
Shared Folder Name - Shared
User Group - FileShare
User Name - UserXP
If you’re on Windows, you can access the shared folder name Shared
under the server name MyServer
by typing \\MyServer\shared
. Alternately, you could browse your network location and you should be able to find your workgroup name and servername. Click on it to access your shared folder. Just make sure that the user account that is currently logged-in in Windows actually exists in ClearOS user accounts.
If you’re on Linux with desktop environment, you could type in smb://myserver/shared/
in your file explorer’s address bar.
You could further customize your settings by creating a read-only group and a group with read and write permission enabled.
T0rrent Server Setup
Transmission comes with ClearOS installation. It is very easy to install using ClearOS Dashboard by accessing the App Market Place.
Installation Steps
Step 1 – Installing Transmission on ClearOS is fairly easy. Just login to your Web Console and access the Marketplace.
To do that, do the following:
Fire up your browser and navigate to
https://your.clearos.ipaddress:81/app/marketplace
Then login with your username and password.
Step 2 – On your left navigation menu, search for
transmission
and hit ENTER key.You should see the Transmission BitT0rrent Client icon, click to highlight it, then click
Install/Upgrade Selected Apps
button to initiate the installation.On the next screen, click on
Download and Install
button.Transmission should start installing, watch for the progress bar.
Step 3 – After successful installation, click on the
Update Navigation Menu
button and then hover your mouse on theServer
button on the top of your Dashboard then click onTransmission
.Now, start the service by clicking on the
Start
button from the right menu. It’s the button that corresponds toAction
label.Step 4 – Setup a password for your Transmission WebUI. Enter your desired password under the Password dialogue box. Then click
Update
button to save the changes.Step 5 – Login to Transmission Web UI by clicking on
Go To Transmission Management Tool
button.Login prompt should pop-up, the default username for Transmission is
admin
, while password is the one you enrolled in Step 4 above.Then that’s it! You now setup and configured Transmission on ClearOS.
Note: If you didn’t update the password, then just login to Transmission Web UI without entering any. Jut hit Login button.
Software Router Setup
This is very straight-forward to setup, especially when you have lots of experience tinkering with your home routers.
To access the app page, go to: https://your.server.ipaddress:81/app/dhcp
I will expand on this topic in the future, whenever I get time.
Apps Related To This Service:
- Bandwidth Manager
- Port Forwarding
- 1-to-1 NAT
- Multi WAN
- DMZ
That’s a Wrap
I hope you found this guide useful and applicable in your case, be it in an office or home use.
Using ClearOS, you could setup a multi-in-one Linux Server. You could still add features and services to your server by installing additional apps using ClearOS Market Place. There are lots of Free or Paid application that you might find useful for your mode of operation.
If you have something to share about Clear OS setups and configurations, or some clarifications or corrections, please feel free to post them below.
Thanks for taking time reading this post.