My own webserver at home using Intel stick ubunto

Hi, cool video, I saw Saturday, https://youtu.be/bofjZzPapoc
I would like to see if this idea of mine is good, if it works, or seek alternatives.
I would like to host my website and some music files, mp3, maybe mp4 videos. I have done this before using a desktop running ubunto, via https://www.barnesandnoble.com/w/how-to-setup-a-linux-web-server-michael-wright/1118083735
It worked well.

  1. Can the Intel Stick running Ubunto be turned into a web server?
  2. This same book already tells me how to open a port on the router and it uses a LAMP (Linux, Apache, MySQL, PHP) server, within the Ubunto install.
  3. So it seems all the pieces are here. am I missing something?

background details:
a. I’d like to avoid a hard drive and desktop noise, but I was looking for these small desk tops, Lenovo M92p, https://www.microcenter.com/product/600169/m92p-thinkcentre-tiny-desktop-computer-(refurbished), and the MicroCEnter.com website popped up with a Intel stick aside this Lenovo M92p.
b. save energy costs, perhaps the monitor or TV always needs to be on…(?)
c. I’m OK if the website is slow, I think, or perhaps I can make it only text and photos and mp3 on the web server.
d. are there other alternatives or examples of home webservers, just need 1 or two websites, like for a small music label?

do you plan to access this outside your own ISp/home connection because majority of ISP block web traffic hosting unless you pay for a business plan.

Also running a open and slow server, in general on a home network can be a bad idea if youre not sure what youre doing because of the possibility of attacks. its another point of access, even a jailed BSD / Jailed VLAN can be compromised under the right chances.

Not trying to scare you off but give you a better score to understand.

you might be better off finding a cheap hosting solution.
http://www.nosupportlinuxhosting.com/

there is also SSH forwarders out there to solve this for home PC as well.

you would also be better own running a “Owncloud” if it just for personal files.

You can get a free server with 1vCPU, 1GB of RAM, up to 30 gig of space on aws.amazon.com without too much of configuration. It’s also a good place to learn, especially if you screw up and have to start from scratch with a new server installation. Then it’s just to delete your instance and make a new one.

Like nomelons mentions, the security problem, at least with aws, you won’t have to deal with most of it.

I’d check out their free tier, reasonable things to muck around with.

yes. I plan to access it from away from home, from anywhere. Thanks for the alternatives. Owncloud seems cool as it is free. I suppose I would just disable all the security it seems to offer and put html files and images there. I could not tell from their website, if it actually can be a a website host, or if it’s more like a DropBox. However, is there an example of someone doing this? Thanks for the AWS idea, Amazon is not free, but I see, it would get me started, and can be like s sandbox to play in, but as a reminder for other readers, this is what I found on amazon’s website, …When your 12 month free usage term expires OR if your application use exceeds the tiers, you simply pay standard, pay-as-you-go service rates (see each service page for full pricing details)…But AWS also has an “always free” product page. I don’t mean to be saying this won’t work for me, but some specific links, if you have them, or know how to untangle the marketing trickery and navigate to the what is the best free one, let me know again. Looks like Amazon “Macie” product offers 1 Gb for always free. this asks for credit card too, so seems like after 12 months, I’ll get charged. thank you.

I understand your hesitation, been there myself, but must admit I don’t regret using Aws. I’m using it for git server, hosting several web sites, OpenVPN host for small things and a few flask APIs I tinker with.

I’ve been using Aws for three years now on the same account, always stayed below 30 gig disk usage, and therefore never had to pay. I’ve had to pay a few bucks once or twice for compute time, but at those times the server did some actual work.

Am out of the house at the moment, but can write a more detailed explanation later or tomorrow if you like.

1 Like

Yes, please.

I’ve just tried running a simple flask website from home. I’m using docker-compose and you definitely shouldn’t use it for production but my 2006 Thinkpad has 1.5GB RAM and spinning rust and it seems fine.

You can use let’s encrypt companion and it works very well. The main benefit of docker is basically you can do git pull, docker compose up and be reasonably sure things will work (or fail) the same way in different environments.

@kush good point with git pull and docker compose. I do similarly on my AWS instance.

Forgot to mention earlier, an alternative I’ve only heard good things about at recent prices vs what you get, is with DigitalOcean. They have very good tutorials for a lot of things. Worth checking out for setting up your server for the first few times. There are some nice guides for several different OS for setting up for a LAMP server for instance.

I do agree, the products and pricing on AWS appears to be a nightmare, there are so many things that it’s near impossible to get a clear overview of what’s what and how much it cost at the end of the day. Aws does have a nice Billing panel with a great overview, so you can track everything at any time.

In the end of creating your instance you’ll be able to download a key file, *.pem. Download this one and store it in more than one place, if you lose it, it can be a tedious nightmare to get one from amazon, since they are insanely strict when it comes to security. Without it, you lose access to your instance without it. Don’t forget to chmod 400 file.pem or you won’t be able to use it with ssh -i file.pem [email protected].

At the end of the day, there aren’t many things you need to look at when you start out. There are EC2, VPC, Elastic IP, Spot Instances, EBS and Route53, will explain what they are further on. Below is a screenshot of one of my earlier bills when I was using free tier servers. At the moment I’m paying for one, because I need 4 gigs of RAM due to git server and some other services.

One thing that doesn’t show on my bill is traffic, all uploads to your server are for free, downloads cost. I have yet to be billed for downloads, and I’ve been in the 10 gig area. If you do have files to transfer to other people, consider storing these files on dropbox and simply add a link to those on your website that’s hosted here. Just an idea.


As you can see, it has a Linux t2.micro instance with 283 hours on it. The hours doesn’t mean it’s been for that amount of hours, 1 hour = 1x [email protected]% for 1 hour, at 10% utilization you’d get 10 hours of running out of it. You have 720 hours/month for free

Route53 is DNS service. If you have your own domain, you can move it here, and will have easy access to administering it, create sub domains as you please for virtual servers. More on Route53 below.

EBS storage, as you can see is below the monthly free tier, and is therefore free of charge. More on EBS below.

The good thing with using Route53, is the time it takes to update. Since AWS is hosting some of the top tier DNS servers, the update is close to instant. In many cases, you’d have to wait 3-6 hours, sometimes 12 hours or more for the sub domain you created to propagate to lower tier DNS servers. This even works when running over dodgy DNS servers, I’m currently using Russian DNS servers, they block a large amount of the google tracking and commercials crap, so I have a lot less spam on websites because of this.

VPC is Virtual Private Cloud, it’s a bit of an advanced feature, the standard settings are fine for starters, but using this, it’s possible to segment and have complete control over your cloud network, which can be v nice in some situations. In free tier you can have two of these, everyone after that cost. VPC is dependent on the availability zone you chose to create you server in, so if you already have a VPC in zone A, you can’t access it in zone B without messing around a bit. (more on zones further on)

Elastic IP is a neat feature. It gives you a static IP on the internet. So lets say you setup your server with DNS and all the fixings, something goes tits up and you have to setup a new server. All you have to do is to move you Elastic IP to your new instance, and everything previously configured will point to your new server. You can have one elastic ip for free.

EBS storage can be used to make your experimenting easier. You have the standard image with your OS. This is an 8GB image/volume, for the remainder of your data, it’d be a good idea to make one or two other volumes, and on these you store the services you want. This could be websites, your data files, configurations and whatever you might need. If you ever have to reinstall your server because of something going wrong. You simply mount these volumes on your new server and symlink or bind mount to your services to your data on there, and within a very short time, you’re ready to go again. We’re looking at 10 minutes from taking down old server until everything is back up and running again with all the fixings. In a case where you start mounting extra drives, add them to fstab using their partuuid and not their direct device name (/dev/xvdbX). Can save you a lot of grief.

Spot Instances are very nice, if you want to try out something that requires more processing, or just want to have a bigger server to work on for little money. It’s possible to get 4vCPU, 16GB RAM with 90% discount. Beware tho, I’ve had a spot instance up for 3 months without any down time, but I’ve also had spot instances that ran for 6 hours, and then were down for 18 hours. These instances are running on leftover server power. So if you’ve created your server in an availability group (more on this in a bit) with high traffic, you can expect for full paying customers to eat the extra resources that were available, and your instance will therefore be shut down until resources free up. There are two different calculators in your management console in regards of Spot Instances, there you can see pricing and uptime over the last months and get a feel for the zone.

Most Zones (data center in for instances Frankfurt, Ireland, Ohio), are divided into availability groups. My servers are located in Frankfurt, so I’ll be using that as reference, has three groups, A, B and C. A and B are quite well saturated, and therefore have very little resources left over, so for instance starting a spot instance in one of these will have greater down time than if you created your server in group C.

There is loads more to AWS, but this should be ok to at least get started a bit. If you have any more questions, feel free to ask. Glad to help.

2 Likes

Microsoft gave me $100 in credit to learn so I immediately set up two “devops” projects. Basically one in Django and one in Flask (I think). I’ve since deleted the django one because as you can see, just pushing a python project, having it build, and running it (the applications don’t do anything, I don’t even have a database connected to them!)

The cost is pretty steep. Azure devops is cool but if I am paying for devops I want build to run faster than they do for me. All in all the experience was not very good.

Here’s the repo https://gitlab.com/kush/openroomazurewebsites

Can only agree on Azure, it is kinda pricey.

I too tried it briefly, and must admit, I quickly went back to AWS, first of all because of price, but wasn’t too satisfied with Azures implementation of offered services.

1 Like

$1/month seems too good to be true. It would take years to add up to the same cost I paid for a refurbished R710 not even counting storage expenses and electricity bill since it typically uses 145W already by itself without storage.

Also not counting that in a few years, it’s likely that I will replace the R710 with a build with a lower power consumption, an R7 1700/2700 seems like a solid CPU to use already for that purpose or even the R5 1600/2600 really, not to mention what’s coming. Not to mention other upgrades.

A. I am trying AWS. any tips on where “website” is? I see a section called “Deploy Code.” And another section called “Build Web App.” This Build web app, asks for a PHP file, as I sort of knew PHP. But it does not let me upload all the images and html files.
B. regarding doing my own web site at home, are there any tips on managing dynamic IP address that my comcast internet provider may change about every 6 months?
C. Elastic IP, is this only a feature in AWS? Is it useful? I see AWS let’s me create a static IP, which seems to be necessary for a website. Is anyone using static IP within AWS?
D. Also, from Flask, I surfed onto this dude’s other project, https://www.getlektor.com/showcase, this seems like website software, something that could replace XAMPP or LAMP.
E. I also recommend, this free host, https://x10hosting.com. I have to login into the CMS/cPanel once a month, otherwise they may delete my account. And I use their URL, but they have some choices, like, mycoolsite.elementfx.com, or myothersite.x10host.com,…etc.
F. Conceptually, industry pioneer-wise, I still am kind of scratching my head about why I am not able to stick a usb into a home router and have it configured as a simple personal (free) website that’s always on like my router. However, to code, which can be cool, there are hundreds of frameworks, tools, codes, logins to create.
I usually have a lot of questions. thank you for the ideas, links, screen shots and recommendations.

Sounds like a guided thing, I never use those, they rarely make any sense to me, so I just do it all manually myself.

Could get access to your domain host and manually change it there when there is an IP change, since it’s not that often. Could also make use of an API with your DNS host, and update on ip change from home. Aws/Route53 has such API.

Elastic IP is permanently your IP, until you delete it or it expires while not being used. The other IP you can set for a node is kinda temporary. There’s a chance the IP will change on a node reboot.

Flask really isn’t that complicated, and personally, I think you’d get more out of doing the initial legwork yourself. Also, if you’re hosting it online, setup an Apache reverse proxy with a path (www.youradd.com/api/v1 -> 127.0.0.1:5001), don’t expose port 5000, 5001, 5002 etc to gain access to the service.

Well, you can in many cases. Most proprietary router OS’s won’t allow it, but it is possible to flash OpenWRT on a lot of routers, might be of use to you. Beware though, some have a hard time handling the extra things you add. I’m currently upgrading my router to new OS, and using some dodgy Netgear router i have for backup, and with this one, I can’t download with more than 1 MB/sec, due to CPU power and it running via VPN. You can also build your own using something like this.

My 2 cents on frameworks. While I understand the use of them, i abhor them, in my eyes it’s lazy programming. There’s the security aspect, where one is dependent on the framework being updated in a timely manner, and then there’s the lack of understanding of underlying services. If you setup things yourself, you know what happens, and you have the ability to add what you want to your service.

I was learning flask over the last year or so, I always had a log output of all requests, while it was exposed to the internet, i had several times an hour, attempts on pulling certain files at a specific path. These pulls, were attempts to gain access, using weaknesses of the top 10 most used frameworks. Now imagine if you’re three weeks late on a security update.

Making online services, always remember Keep It Simple!

All that’s required to learn the basics of is, Apache, MySQL, Python 3+ (2.7 discontinued from next year), PHP 7, CSS, HTML. To help with learning these, I can strongly recommend the jetbrains, their IDE’s are very nice, and dirt cheap for private developer its €25/month for all their products.

Yeah, I tend to not like all these frameworks. Though, I did or do like Xampp on linux. Thanks for more ideas.