In the second half of the nineteenth century, Portugal built the main branches of its railway system. In this paper, I will use technical and military reports, parliamentary debates and sundry bibliography to analyse the influence of the different stakeholders. I investigated the expectations, priorities and agendas of engineers, army officers, policymakers and lobbyists in the design of the Portuguese railway network. I argue that historiography about Portuguese railways usually considers the rationale behind their discussion as entirely technological and focuses mainly on their outputs, taking railways for granted, or black-boxed. However, the planification of large transportation systems depends on the sociotechnical context and on hierarchies of power of their time. I will show that experts (mostly engineers) played a decisive role in the planning of the network, but a large part of its design was due to non-technical issues, including political machinations, budgetary constraints and corporative lobbying.