using a playstation 4 as a server 2024-04-22
horrible idea? maybe! funny? absolutely! sysadmin, fun

why?

a while ago, i purchased the domain on-a-ps4.lol. it has, up until now, never been used. however, as of recent i have wanted to host various services on reasonable hardware, and what better excuse to do something funny like this - so let’s change that!

requirements

picking a distro

funny story here - this guide was actually rewritten twice! initially, i picked rocky linux, but didn’t enjoy RPM packaging. i then tried debian, which would not init properly after a reboot - and i have no idea why! after some consideration, i chose alpine linux.

packaging alpine for the playstation

there are decent (albeit ad-riddled) guides on how to do plenty of neat things on ps4linux.com, including how to port your own distro, so i started there.

here are my own alpine-specific instructions:

setup

packaging

to put the distro on the ps4, we need to create a tarball of the filesystem:

tar --exclude=ps4alpine.tar.xz --exclude=.modloop --exclude=media/cdrom/* --exclude=var/cache --exclude=run --exclude=proc --exclude=dev --exclude=sys -cvJpf ps4alpine.tar.xz /
mount -t vfat /dev/sda1 /mnt
mv ps4alpine.tar.xz /mnt

installing alpine on the playstation

ps4linux.com suggests a “new method” for installing distributions on the playstation these days - involving extracting the archive yourself with a tool such as Rufus or Balena Etcher. unfortunately, i could not figure out how to package my own distro to support this, so for now, let’s use the “old method”:

post-installation

congratulations! your ps4 is now, technically, an alpine server, and it should be accessible over SSH.

however, we still have some cleanup to do, so login:

optional

what next?

once i had the ps4 server up and running, i ran numerous tests to ensure it would hold up under load - which it did. i moved it to a better location, added it to my tailnet, and set up nginx as well as frp for the sake of protecting my ip address via reverse proxy.


overall, this experiment was a success - and as of now, the playstation runs an akkoma instance at fedi.on-a-ps4.lol and an srb2 server at srb2.on-a-ps4.lol.


thank you for reading.