There are server colocation providers that allow hosting a 1U server for as low as $30/month, but there's a catch: There are restrictions on power usage (1A @ 120v max, for example) because they're expecting small and power-efficient network equipment like firewalls.
This repo is about designing a server that fits within the 1U space and 1A @ 120v power constraint while maximizing computing power, storage, and value.
TODO: calculate time to pay off vs R620
- Colocation Providers
- Parts
- Power Usage
- Software Setup
- Hardware Setup
- Network Setup
- Remote Power Management Software Setup
- Measuring Amperage
- Single Points Of Failure
- How Many More Pi's Will Fit?
- Cloud Comparisons
- Ideas For V2
- Similar Projects
- $30/month - Turnkey Internet
- 1 Amp @ 120V
- 1 Usable IP (+$10 for 5 usable IPs)
- 10 Mbit Ethernet
- 3 TB Monthly Transfer
- $40/month - Nextarray
- 100Mbps Unmetered
- 1 Amps 120V
- 3 Usable IPs (+$13 for 11 usable IPs)
- GigE Port
- 1.5Tbps Protection
- Location: Dallas, TX
- $50/month - Joe’s Datacenter
- 5 Usable IPs
- Bandwidth: 33TB on 1Gbps Port
- Power: Up To 2 Amps 120V (Single Power Connection)
- Network Connection: Single Network Cable
- Location: Kansas City, MO
- 20x 1.5GHz CPUs
- 16GB LPDDR4-3200 SDRAM
- 1.2TB SSD Storage
- Gigabit Ethernet
Total cost: ~$800
- $85 - Supermicro SuperChassis 1U Rackmount Server Case CSE-512L-200B
- $36.34 - Server Rack Rails
- Depending on the colocation place, these may be provided for free.
- 5x $34.99 - Kingston A400 240G Internal SSD M.2
- Need to use M.2 drives to save space.
- 1x $31.50 - 5-Pack of SAMSUNG 32GB Evo Plus Micro SD Cards
- For failover storage in case the SSD fails.
- $19.99 - NETGEAR 8-Port Gigabit Ethernet Unmanaged Switch (GS308)
- 12v, so can use the ATX power supply easily.
- Using an unmanaged switch due to a limited number of IP addresses, and to make a firewall and router for a private network unnecessary.
- 5x $35 - Raspberry Pi 4b
- Best software support and battle-tested design.
- 5x $12.99 - Geekworm Raspberry Pi 4 Armor Case
- Allows access to GPIO pins, which will be necessary for the Pi wired to the relay for remote power management.
- Uses less space than the Flirc case, which makes it difficult to close the chassis lid.
- Reviews: 1
- $12.99 - ATX breakout board
- $11.88 - Standoffs for ATX breakout board
- 3x $7.99 - USB 2.0 Female Screw Terminal Block Connector, 2-Pack for wiring USB cables to the breakout board
- $8.90 - Toggle switch for powering off the server from the front panel.
- $8.99 - 8 Channel DC 5V Relay Module
- For power cycling most of the Pi's remotely.
- $5.98 - 1 Channel Relay Module
- For power cycling the Pi that controls the 8 channel relay.
- $8.99 - Ethernet Extension Cable w/ screws
- For adding a single ethernet port to the back of the chassis that connects to the switch.
- $26.99 - Kill A Watt Electricity Usage Monitor
- For measuring amperage and ensuring it's below the max.
- $20.95 - Noctua NA-FC1, 4-Pin PWM Fan Controller
- For controlling PWM fan without a motherboard.
- 2x $6.99 - 2-pack of 1ft USB C Cables
- $14.99 - USB C Cables w/ right angle connectors, 6-pack
- The right angle connector is key, this saves a ton of space.
- 4x $2.09 - 1 Foot Long Slim Ethernet cables
- 1x $2.09 - 0.5 Foot Long Slim Ethernet cables
- $8.99 - Zip Tie Mounts
- $10.99 - Mounting tape
- $5.28 - 22 AWG Stranded Copper Wire
- Raspberry Pi 4 + SSD:
- idle: 0.44A @ 5V (0.018A @ 120v)
- load: 0.84A @ 5V (0.035A @ 120v)
- Total w/ blower fan on low setting:
- idle: 0.30-32A @ 120V
- load: 0.36A
- Total w/ blower fan on high setting:
- idle: 0.4A @ 120V
You will need to do this for each of the Raspberry Pi's:
- Flash an SD card with Raspbian Lite (under "Raspberry Pi OS (other)" in the Raspberry Pi Imager) and enable SSH with:
cd /Volumes/boot/
touch shh
- Insert the SD card into the Pi, power on, and ssh into the Pi with
ssh pi@<ip address>
and the password "raspberry". - Update the hostname to correspond to the number on the case:
sudo raspi-config
1 System Options
->S4 Hostname
-> Update hostname -> Finish -> Reboot
- Update the firmware on the Pi to allow booting from USB:
sudo apt-get update && sudo apt full-upgrade -y
sudo rpi-update
(only do this once on each Pi)
- Disable wifi and bluetooth:
sudo bash -c 'echo -e "dtoverlay=pi3-disable-wifi" >> /boot/config.txt'
sudo bash -c 'echo -e "dtoverlay=pi3-disable-bt" >> /boot/config.txt'
sudo reboot
- Add your public key (while disconnected from the pi, with
cat ~/.ssh/id_rsa.pub | ssh pi@<IP-ADDRESS> 'mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys'
) - Make sure the SSD into one of the blue USB 3 ports.
- SSH into the Pi again and Disable password authentication:
sudo sed -i '/^#*PubkeyAuthentication /c PubkeyAuthentication yes' /etc/ssh/sshd_config
sudo sed -i '/^#*ChallengeResponseAuthentication /c ChallengeResponseAuthentication no' /etc/ssh/sshd_config
sudo sed -i '/^#*PasswordAuthentication /c PasswordAuthentication no' /etc/ssh/sshd_config
sudo sed -i '/^#*UsePAM /c UsePAM no' /etc/ssh/sshd_config
- Configure the Pi to prioritize booting from the SSD:
sudo raspi-config
6 Advanced Options
->A6 Boot Order
->B2 USB Boot
-> Finish -> Reboot- If you see an "No EEPROM bin file found" error, you may need to run
sudo -E rpi-eeprom-config --edit
and add[all] BOOT_ORDER=0xf14
.
- Repeat the steps above (without
sudo rpi-update
) with the new OS on the SSD. SSH'ing into the new OS on the SSD may require clearing out the line with the corresponding IP in your~/.ssh/known_hosts
file withssh-keygen -R <host>
.
-
Remove the hard drive bay dividers and front panel extension cable from the inside of the chassis.
-
Install the Raspberry Pi's into their cases.
-
Install the M.2 drives into their enclosures.
-
Insert a SD card into each of the Pi's.
-
Add mounting tape to the bottom of each of the SSD enclosures and attach them to the top of the Raspberry Pi's.
-
Add mounting tape to the bottom of the raspberry pi cases. Don't remove the bottom cover of the mounting tape adhesive yet.
-
Remove the rubber feet from the bottom of the networking switch and replace with 4x small squares of mounting tape. Don't remove the bottom cover of the mounting tape adhesive yet.
-
Add labels with numbers to the tops of the cases. These numbers will correspond to the hostnames of the Pi's in the software setup.
-
Use wire cutters to remove the metal adjacent to the ethernet port and mount the port side of the ethernet extension to the back of the chassis with washers and the included bolts.
-
Cut the plastic piece that came with the chassis (for under the motherboard) to fit under the power supply breakout board.
-
Drill holes in the chassis, insert nylon standoffs, and add the plastic sheet.
-
Cut 10x 6" lengths of red standed wire, strip the both ends, and install one side of the wire end in the "+" slot of the USB terminal blocks and the other side into the 5V terminal blocks of the ATX power supply breakout board. Make sure the 20 pin power supply has a corresponding wire, some wires will be missing and may not actually work on the power breakout board.
-
Cut and strip 10x 6" lengths of green standed wires then install one side of the wire end in the "-" slot of the USB terminal blocks and the other side into the COM terminal blocks of the ATX power supply breakout board. Again, ensure the wire exists on the 20 pin cable before using the terminal block.
-
Mount the ATX power supply breakout board and secure with nylon nuts. Insert the 20 pin ATX power supply connector into the ATX power supply breakout board.
-
Remove the covers from the mounting tape adhesive on the bottom of the Pi cases switch and lay them in the chassis. Don't plug the power supply into the wall yet. You will probably want to try to match the layout from the finished project above, but this may change depending on how many Raspberry Pi's you have.
-
Cut the 12V barrel connector along with 12" of wire off of the power adapter for the network switch. Attach the cable with the solid white line markings to 12V on the ATX breakout board and attach the other wire to a COM on the breakout board. You may want to confirm this is the correct "+" wire for your switch with an ohm meter and the diagram near the power connector the back of the switch.
-
Cut the piece plastic that came with the chassis (for under the motherboard) to fit under the 8 channel relay board.
-
Drill holes in the chassis, insert nylon standoffs, and mount the 8 channel relay.
-
Wire 4 of the 5 5V USB terminal "+" wires from the ATX breakout board to NC terminals on the 8 channel relay, and wire the other side of the relay to the "+" on the USB terminal block for 4 of the 5 Pi's. More relay setup instructions
-
Drill holes in the chassis and insert nylon standoffs for the 1 channel relay.
-
Wire DC+ on the relay to a 3.3V GPIO pin from a Pi that is powered by the 8 channel relay. DC- will need to be wired to a ground GPIO pin and IN will need to be wired to GPIO pin 18. Finally, wire the 5V power from the ATX breakout board to NC, and wire COM to the "+" on the terminal block for the Pi isn't powered by the 8 channel relay.
-
Mount the 1 channel relay to the chassis with the nylon standoffs.
-
Move the jumper on the 1 channel relay from H to L.
-
Plug one of ATX SATA power connectors into the fan controller and connect the blower fan from the chassis into the fan controller.
-
Drill a hole in the front of the case for the power switch and install the power switch.
-
Add a 290 ohm resistor inline with a 6" length of wire with a jumper connector on one side, add heatshrink, and add that wire to a 3.3V terminal on the ATX power supply breakout board.
-
Add another wire of the same length with a jumper connector on one side to a COM terminal on the power supply breakout board, then put the jumpers onto the pins of the LEDs on the front panel.
-
Apply electrical tape over the unused header pins and terminal blocks to prevent accidental electrical shorts.
- Get the static IPs, subnet, and gateway from the colocation provider.
- Edit
/etc/dhcpcd.conf
on each of the Pis and add the networking info from the colocation provider, for example:interface eth0 static ip_address=192.168.1.191/24 static routers=192.168.1.1 static domain_name_servers=8.8.8.8 8.8.4.4
sudo reboot
Only do this on the power management Paspberry Pi connected to the relay:
curl -o relay_control.py https://raw.githubusercontent.com/pawl/raspberry-pi-1u-server/main/relay_control.py
- Test the script:
python relay_control.py
You should see the light on the SSD flash off and on for the Pi whose relay's GPIO pin you entered.
- Plug the server into the Kill-A-Watt.
- Press the button on the Kill-A-Watt for "amps".
sudo apt-get install stress
while true; do vcgencmd measure_clock arm; vcgencmd measure_temp; sleep 10; done& stress -c 4 -t 900s
- Restart the server by unplugging and plugging back in. Watch the amperage on start-up.
- Switch
- Relay
- Power Supply
- Electrical Short (from loose terminal or pinched wire?)
- The Management Pi Dies (and can't powercycle the other Pi's)
At least 7. (including 1 Pi Zero and a Pi 3b)
This is a tough comparison to make because the Pi CPUs are only 1.5GHz per core.
- T2.micro - $9.50/month for 1GB Ram & 1 CPU @ 2.5 GHz * 20 = $190/month
- T2.medium - $38.00/month for 4GB Ram & 2 CPU @ 2.5 GHz * 10 = $380/month
The T2 instances have a limited number of CPU credits, which means they can't run at 100% all the time like the Pi can.
$20/month for 4GB Ram & 2 CPUs @ 2.5 GHz * 10 = $200/month
- BitScope Blade Rack
- Doesn't have as much room as the 1U chassis.
- 1U Raspberry Pi rack
- No room for storage, power supply, and a switch to allow for consolidating ethernet connections to the single cable required by the colocation provider.
- Doesn't match the usual server form factor, and some colocation providers might not like this?
- UCTRONICS Ultimate Rack with PoE Functionality for Raspberry Pi 4
- iStarUSA
- Dell R620
- Other options on Labgopher?
- SOPINE Clusterboard
- Supports 7x compute modules, has a built-in switch, and can be powered by an ATX power supply.
- Out of stock at the time of writing (June 2021).
- Raspberry Pi CM4
- Back-ordered for months at the time of writing (June 2021).
- TuringPi 2 has not been launched yet as of June 2021.
- RockPro64
- 6x CPU cores
- Quartz64 Model B
- Has a built-in M.2 slot.
- ODROID-XU4
- Banana Pi M4
- Built-in POE
- Mini-ITX motherboard with low-power processor
- No case, drill holes for stand-offs, and mount to the chassis.
- More work, but would probably work fine and small heatsinks would be cheap.
- Argon ONE M.2 Case for Raspberry Pi 4
- Includes an M.2 storage adapter.
- $44.99 - Samsung 860 EVO SSD 250GB M.2 SATA
- $60 - ORICO 128GB Mini M.2 NVME
- Fast NVMe drives might be bottlenecked by usb?
- http://pibenchmarks.com/popular/
Note: I tried using 2.5" SSDs with inateck enclosures and there wasn't enough room.
- USB Hub
- Rosonway 16 Ports 100W USB 3.0 Data Hub
- Allows software control with uhubctl.
- Rosonway 16 Ports 100W USB 3.0 Data Hub
- POE (maybe there are colocation providers that provide this for you?)
- $20 - (PoE+ HAT)[https://www.raspberrypi.org/products/poe-plus-hat/]
- At the time of writing (June 2021), the POE+ hat has some issues.
- POE switch
- $110 - Netgear GS108PP (supports POE+)
- $69.99 - NETGEAR 8-Port Gigabit Ethernet Unmanaged PoE Switch (GS308P) (no POE+, only 53W)
- $20 - (PoE+ HAT)[https://www.raspberrypi.org/products/poe-plus-hat/]