The offshoring of production by multinational firms has expanded dramatically in recent decades, increasing these firms' potential for economic growth and technological transfers across countries. What determines the location of offshore production? How do countries' policies and characteristics affect the firm's decision about where to offshore? Do firms choose specific countries because of their policies or because they know them better? In this paper, we use a very rich dataset on Danish firms to analyze how decisions to offshore production depend on the institutional characteristics of the country and firm-specific bilateral connections. We find that institutions that enhance investor protection and reduce corruption increase the probability that firms offshore there, while those that increase regulation in the labor market decrease such probability. We also show that a firm's probability of offshoring increases with the share of its employees who are immigrants from that country of origin.