Over a million developers have joined DZone.

Setting Up Your Own Linux/.NET Home Web Server

DZone 's Guide to

Setting Up Your Own Linux/.NET Home Web Server

One developer shows us how to use one of his GitHub-hosted projects to create a secure web server on your machine, that can be accessed from anywhere.

· Web Dev Zone ·
Free Resource

I have created a small script, which will automatically setup everything for you, on an empty Linux Ubuntu server, in half an hour, to be able to run ASP.NET on Linux. For the record, my script is tailored to install Phosphorus Five, which is a home web operating system, but it could probably easily be modified to install your own ASP.NET application, with some tweaking.

The way I set it up on my machine, is on a dedicated Ubuntu Server, which then uses an SSL certificate from LetsEncrypt. Then I created a DNS "A" record for my domain, pointing to my external IP address, in my home. Effectively, this configuration, gives me a home web operating system, from where I can develop and install any apps I wish to install, and access my apps over SSL, from anywhere I might be in the world. The thing renders perfectly on any device, including smartphones, tablets, and laptops.

Out of the box, there only exists one app, which is Sephia Five. Sephia Five is a webmail client, with, among other things, PGP cryptography, that even encrypts the subject line of your emails. So this is an extremely secure system. Its default configuration also disallows the downloading of most attachment types that could potentially contain malware or viruses, in addition to safeguarding against sending an email to the wrong recipient.

The How To

First, install a "virgin" Linux Ubuntu Server. Please use the default configuration. Apache and such will be installed later, through my little script. Afterwards, download my script, and turn it into an executable, with the following terminal command; "chmod +x install.sh." Then run the script as root, with the following command; "sudo install.sh". When it's done executing, you'll have Phosphorus Five installed, and you can download Sephia Five from its Bazar. However, you'll need to figure out your server's IP address, which you can do by running the following command in your server's terminal window: "ifconfig | grep addr."

Notice that you'd probably want to tie down your server further, and make it more easily accessible from outside of your home, by registering a domain or something. You can then afterward install an SSL certificate on it. First setup your domain, with a DNS A record, then follow the recipe found here, for how to install an SSL certificate on your server. Figuring out your external IP address, such that you can forward your DNS record to its IP address, is probably most easily done by simply searching for "what is my IP address," and visiting the first link.

Then open up your router, and make sure you forward any requests on port 80 and port 443 to your Linux box, and you have your own personal home web server. Your router can probably be setup by visiting from your browser. If it's password protected, a simple Google search for its name/model will probably yield its default username/password combination. And voila!

Welcome to your own personal home web server and cloud!

linux ,.net ,ssl ,web dev ,web server

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}