The biogenesis, maintenance and function of primary cilia are controlled through intraflagellar transport (IFT) driven by two kinesin-2 family members, the heterotrimeric KIF3A/KIF3B/KAP complex and the homodimeric KIF17 motor. How these motors and their cargoes gain access to the ciliary compartment is poorly understood. Here, we identify a ciliary localization signal (CLS) in the KIF17 tail domain that is necessary and sufficient for ciliary targeting. Similarities between the CLS and classic nuclear localization signals (NLSs) suggest that similar mechanisms regulate nuclear and ciliary import. We hypothesize that ciliary targeting of KIF17 is regulated by a ciliary-cytoplasmic gradient of the small GTPase Ran, with high levels of GTP-bound Ran (RanGTP) in the cilium. Consistent with this, cytoplasmic expression of GTP-locked Ran(G19V) disrupts the gradient and abolishes ciliary entry of KIF17. Furthermore, KIF17 interacts with the nuclear import protein importin-beta2 in a manner dependent on the CLS and inhibited by RanGTP. We propose that Ran has a global role in regulating cellular compartmentalization by controlling the shuttling of cytoplasmic proteins into nuclear and ciliary compartments.