Using airport extreme as time capsule and postgresql server

Discussion in 'iMac' started by paintstone, Jul 19, 2019.


Can this easily be done

  1. Yes 1 to 5 hours

    0 vote(s)
  2. Yes 5 + hours

    0 vote(s)
  3. No, there is a better way from the iMac

    1 vote(s)
  4. No, use Azure or AWS.

    1 vote(s)
  1. paintstone macrumors newbie


    Jul 19, 2019
    So I have a 2013 27" iMac and it's connected via a firewire 800 cord and ethernet cord to my airport extreme. I want to know if it can be done (relatively easily) that I can access a PostgreSQL server on iMac imac or the airport extreme from my 13" MBP via an internet connection?

    This involves a Machine Learning project in python that I have been coding up the last few years and this idea didnt come up in searches on the site, so I am asking.

    There was this old tutorial that I found but not sure if it is relevant, so thank you in advance if you can point this thread to an existing example of what I'm looking for. Does this also highlight the dual challenge that I might need to stop using the airport as both a time machine and PostgreSQL server?

    Summary TLDR

    I have connected my iMac and an airport extreme via firewire and ethernet. Currently, they are acting as a time machine with a 4tb HDD upgrade. Can I start and serve a postgresql database on the airport extreme and access it on my MBP from any internet connection. I'm thinking I can but there must be pages of instruction somewhere, just can't find it.
  2. priitv8 macrumors 68040

    Jan 13, 2011
    Some thoughts that come to my mind:
    • APX is only capable of file and print sharing, so you won't run PostgreSQL server on it. You could use it as a network storage for the database file. This means - you'd need still another computer to run the SQL server on.
    • APX is a terribly slow file server. It's CPU spends most of the time minding the network and routing tasks.
    • You can access anything behind the APX (or it's network file shares) once you've set up the port forwarding for necessary ports. This needs to be done on the external perimeter router (the one that has its WAN port connected to your ISP).
  3. theluggage macrumors 68040

    Jul 29, 2011
    I'd say that if you want to run a 'home server' accessible from the Internet, from a typical home internet connection, these days some sort of cloud-based server is the answer. Azure, AWS... or you can get a basic virtual Linux server for $5/month from Linode.
    • Typical home internet connections don't include a fixed IP address - you may be able to work around that if your router supports dynamic DNS but its an extra hassle.
    • Your ISP T&Cs may prohibit running a server (its up to you how seriously you take that) or even block certain ports.
    • You'd have to open up ports on your Internet firewall.
    • You might have to faff around with using alternative ports for incoming HTTP requests, etc. which some ISPs might block.
    • Many home connections have an 'upload' rate that is much slower than the headline download rate - which will severely limit your server.
    If you do want to go ahead and do it at home, I suspect that PostgreSQL on the Airport Extreme would be a non-starter, so my suggestion would be to run PostgreSQL in a Linux virtual machine on your Mac (VirtualBox is free - Docker is another option - learning curve involved but it could be useful for what you're doing) Set the virtual network connection as 'bridged ethernet' so it shows up as a device on your home network and gets allocated an internal IP address by your firewall/router. Don't enable VM features like shared folders - you want this to be a sandbox that can't touch your Mac.

    Set up SSH logins on the VM. Set PostgreSQL to only accept connections from 'localhost'.

    Now set your firewall/router to forward incoming connections on port 22 to the (internal) IP address of your Linux VM. So if you SSH to user@your,public.ip it should connect to the virtual machine & let you run pgsql on the command line, or use SSH tunnels to connect a remote copy of PgAdmin etc. You could forward port 5432 for direct connection to Postgres, but friends don't let friends expose unencrypted ports so you'd want to configure Postgresql to exclusively use SSL (...using SSH is probably easier and you're probably gonna need it anyway).

    That's letting you access Postgresql - although what I'd assume you want to do is run a web app on the same machine that you accessed via HTTPS (and which talked to Postgresql locally via a Unix socket).
  4. Mikael H macrumors 6502a

    Sep 3, 2014
    I’d say an experienced person should be able to achieve what you want to do in a couple of hours. However,
    unless you want to present a web service from your home, I would suggest looking into creating a secure VPN from your laptop to your home network or the iMac specifically. The Internet is a dangerous place to host services unless you know what you’re doing. Never present to the Internet services that weren’t originally intended for and designed to be used on potentially hostile networks.
  5. mikehalloran macrumors 68000

    Oct 14, 2018
    The Sillie Con Valley
    Airport Extreme? Really? Which of the 6 versions?


    Was there really a version with a Firewire port?

    Firewire support for the iMac was dropped in 2012.

    What's really going on?

Share This Page

4 July 19, 2019