Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

How to Use Raspberry Pi as a Game Server- (Part 35/38)

By Ajish Alfred November 11, 2013

The Raspberry pi is a mini computer which is designed in a single board with all the essential components required for running an operating system. The Raspberry pi is a device which uses the Broadcom controller chip which is a SoC (System on Chip). This SoC has the powerful ARM11 processor which runs on 700 MHz at its core. This minicomputer comes without a display unit, but it can be used with HDTV display or normal NTSC or PAL standard TV screen. It has an Ethernet port which allows it to be connected to a network. Operating systems from Mac, Windows and Linux can be loaded in the Raspberry pi. The capability of this inexpensive board to load operating systems from Linux and accessibility of the board through a LAN network makes it a perfect choice for tiny dedicated web servers.

This article focus on how to configure the Raspberry pi board as a web server and the technique to make it serve a graphical game for those who type the IP or address of the Raspberry pi board from the address tab of their web browser. The Raspberry pi web server is available in the same LAN network or it can be made available to anyone who has the internet connectivity using the technique of port forwarding. 
[[wysiwyg_imageupload:11069:]]

 


 

In this particular project Ubuntu is installed on Raspberry pi board and is loaded on the Raspberry pi board and is connected to a router using a cross-over LAN cable. Hence the only additional hardware required with the Raspberry pi for this project is a LAN cable only.

Once connected to the router with Ubuntu OS on it, it can be accessed remotely from other systems connected in same LAN network. The board can be accessed from a Linux PC using the secure shell which is enabled in the Ubuntu of Raspberry pi board.  If the IP of the Raspberry pi board in the network is say, 192.168.1.5 then the following command can be used to login as the user named ‘pi’ in the Raspberry pi;
ssh [email protected]
The password for the username ‘pi’ will be prompted and it is ‘raspberry’ by default. The same can be done from the windows system with the help of software like ‘PuTTY’ which can be downloaded for free. One might find difficulty in finding the IP address of the Raspberry pi board in the LAN and it can be easily done with the help of software like ‘Ip Scanner’.
Check the IP range of the router before further editing and it can be simply found by checking the IP of the system which is use to access the Raspberry pi board. For a Linux PC the IP address can be found by using the command;
ifconfig
and for a windows system the IP address can be found using the command:
ipconfig
Now add the following lines below that commented statement;
Make sure that the will set for the Raspberry pi board is not already in use for any other PCs and it can be done by using the ‘ping’ command from both Linux and Windows PC.
If there is no PC having the IP address 192.168.1.68 then the following ‘ping’ command should fail.
ping 192.168.1.68

 

Once logged into the Raspberry pi, the first think to do is to set a static IP address and it can be done by editing a single file in the Ubuntu. The file named ‘interfaces’ need to be edited and saved which is in the directory /etc/network. Open the file using the VIM editor and disable off the following statement;
iface eth0 inet static
The statement can be disabled by commenting it off like as shown below;
# iface eth0 inet static
If the IP of the PC found to be like 192.168.1.5, then write the following statements only

                                                                                           address 192.168.1.68

netmask 255.255.255.0
gateway 192.168.1.1
Save the file and it is suggested to restart the Raspberry pi board which will set the new IP address as 192.168.1.68.
If the IP of the PC found to be like 192.168.0.5, then write the following statements only
                               address 192.168.0.68
netmask 255.255.255.0
gateway 192.168.0.1

 

 

Save the file and it is suggested to restart the Raspberry pi board which will set the new IP address as 192.168.0.68.
Use the following command to reboot the Raspberry pi board;
reboot

 

Once the Raspberry pi reboots try to login using the new IP address.
The next step is to download and install the Apache server for the Ubuntu. It can be done using the following commands;

sudo apt-get update

sudo apt-get install apache2
Now simply copy the game folder in the directory “/var/www”. Change the permission of files in the game folder named say ‘game’, using the following command so that it can be accessed by others in the network.
chmod 777 game/*
Now open a browser in the PC and type the address of the Raspberry pi board in the address tab and start playing the game.
The Raspberry pi is connected to the port number 80 of the router and it can be forwarded to the internet by logging into the router and do the settings under ‘PORT FORWARDING’, the steps will vary from one router model to another.
Enable the forwarding of the port 80 using the following details;

 

Port to be forwarded : 80
Starting port number : 80
End port number : 81
Protocol : ALL or TCP/UDP

 

Find the public IP of the router also and if the public IP is say 123.238.112.227; then one can use the same IP to play the game from the Raspberry pi game server from anywhere around the world using a web enabled device.

 

Project Video


Filed Under: Electronic Projects, Raspberry pi
Tagged With: game server, Raspberry Pi
 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: 5G Technology
This Tech Toolbox covers the basics of 5G technology plus a story about how engineers designed and built a prototype DSL router mostly from old cellphone parts. Download this first 5G/wired/wireless communications Tech Toolbox to learn more!

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • How best to synchronise the UCC38C45?
  • floating node warning in LTSpice
  • Collector Current Low side Has a large drop respect High Side during Miller during Double Pulse Test
  • Diode recovery test Irrm timing.
  • The Analog Gods Hate Me

RSS Electro-Tech-Online.com Discussions

  • How to make string LEDs?
  • Raise your hand if your car had one of these:
  • The Analog Gods Hate Me
  • Display TFT ST7789 (OshonSoft Basic).
  • Fixing board, Easy question HEX SCHMITT

Featured – LoRa/LoRaWan Series

  • What is the LoRaWAN network and how does it work?
  • Understanding LoRa architecture: nodes, gateways, and servers
  • Revolutionizing RF: LoRa applications and advantages
  • How to build a LoRa gateway using Raspberry Pi
  • How LoRa enables long-range communication
  • How communication works between two LoRa end-node devices

Recent Articles

  • How to monitor temperature and humidity on a TFT display with graphics
  • Tria modules integrate edge AI processing with multi-core processors
  • pSemi introduces RF switch with 52 dBm PMAX,PEAK and 90-dBm IIP3 linearity
  • XP Power launches 1.3 kW power supply with 58.9 W/cm³ density
  • How to enable Wi-Fi provisioning in ESP32-based IoT products

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe