Agstafa is on the main Baku–Tbilisi rail line and the parallel M2 highway. The overnight train from Baku is the most comfortable option, leaving in the evening and arriving the next morning; daytime trains and buses to and from Baku also run. Marshrutkas (shared minibuses) run regularly to Qazax and Ganja.
If you are entering or leaving Azerbaijan, the Red Bridge crossing on the Georgian border is about 40 km north-west. Onward marshrutkas run from Agstafa station to the crossing and from there to Marneuli and Tbilisi on the Georgian side.