In this paper, we tackle the design issue of optimal deployment of low power wide area network (LPWAN) Internet of Things (IoT) gateways (GWs). We classify GW deployment problem into two different categories, i.e., network-aware and network-agnostic. In network-aware GW deployment, precise location of IoT end devices (EDs) is known and thus the design questions are: 1) where to place GWs, i.e., to maximize received signal strength and 2) given received signal strength which GW should the ED be associated with to balance the network load. For, Network-agnostic GW deployment, same questions are answered in the absence of precise knowledge for the locations of EDs. For the network-aware deployment we borrow tools from machine-learning such as K -means clustering for determination of optimal GW location. Subsequently, the link assignment problem is presented as an integer linear programming optimization. We prove that the network-agnostic GW deployment principle of placement of GWs at highest altitudes, if applied automatically, may lead to very deteriorated network performance increasing the network operational costs. Consequently, we introduce the concept of network-agnostic GW placement algorithm whereby the location of GWs can be estimated without prior knowledge of specific locations of EDs and we use it as a guiding principle to design spatial algorithm for finding GW locations. We show that spatial algorithm can, in principle, provide effective GW placement suggestions compared to a network-aware method such as K -means clustering. We show that using a computational method for GW placement like K -means or spatial algorithm, has a potential of creating competitive network performance using just the same number of GWs, thus cutting down the financial costs of the network and increasing its sustainability.