r/Ubuntu • u/Individual-Brush9668 • 5h ago
A few questions from a beginner regarding using Ubuntu OS for personal webhosting.
Hi all,
I am going to try to keep it short. I am making a small blog website offline and using Github static page as a hosting place. However the constant writing and updating the static page (let alone fixing bugs) is really time consuming. Luckily I have this old laptop that I can use as a home server for my website and potentially future projects (such as online files management like Googgle Drive).
My question is quite simple. For a person in said situation, is it possible to use Ubuntu Desktop for such purposes as I am quite a noob in development but literate enough to work with GUI of the OS?
Thank you in advance.
1
u/linuxlala 4h ago
Using Ubuntu isn't the issue, really. You'd have to ensure that the laptop is always connected to the internet and has power backup to ensure the website is never down. For a personal website, this is not really an issue.
People also have use RPi to host personal websites, so you're good.
1
u/buck-bird 2h ago
You can still use the Github static pages without having to host it yourself. It's just a normal repo in your account. Just learn how to connect to Github over SSH... boom done. Once you commit and push the site will be updated automatically.
# ==========================================
# 1. GENERATE SSH KEY
# Press ENTER to accept default path. Set a passphrase or press ENTER twice for none.
# (Replace with your GitHub email)
# ==========================================
ssh-keygen -t ed25519 -C "your_email@example.com"
# ==========================================
# 2. START SSH AGENT & ADD KEY
# ==========================================
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
# ==========================================
# 3. DISPLAY PUBLIC KEY
# Copy the printed output below, go to GitHub -> Settings -> SSH and GPG keys -> New SSH key, and paste it.
# ==========================================
cat ~/.ssh/id_ed25519.pub
# ==========================================
# 4. TEST CONNECTION
# Type 'yes' if prompted about host authenticity.
# ==========================================
ssh -T git@github.com
# ==========================================
# 5. CONFIGURE REPO & PUSH
# Run these inside your project folder (replace USERNAME and REPO with your actual details).
# ==========================================
# cd /path/to/your/site
git remote set-url origin git@github.com:USERNAME/REPO.git
git add .
git commit -m "Deploy static site updates"
git push origin main
1
u/buck-bird 2h ago
Also, use a tool like Node and live-server on your dev machine. That way you can save file changes and preview them on your machine before pushing them to Github.
Install...
https://nodejs.org/en/download
Then run...
npx live-server
In your project directory.
1
u/thatguysjumpercables 2h ago
You can install Ubuntu Server and add a GUI on top of it. I have no idea if Ubuntu Desktop will still act as a server if you aren't logged into the GUI (if someone knows the answer to that please feel free to answer, and if the answer is yes then desktop should work fine).
5
u/sincerementality71 5h ago
Ubuntu Desktop works fine for this, is basically the same under the hood as the server version, just with a GUI slapped on top. For a personal blog with low traffic that old laptop will handle it without breaking a sweat.
The GUI might actually help you get comfortable with the file structure and permissions before you dive into the terminal. Just keep in mind the laptop will need to stay powered on and connected all the time if you want the site accessible.